allow basic auth with access token
@nlehuby a workaround to connect from JOSM
Allow a client to login with Basic Authentication with:
- username:
access_token - password: a valid access token
To generate an access token from the seed with curl (change username and password with yours) :
curl -s http://localhost:3030/realms/yukaimaps/protocol/openid-connect/token --data 'grant_type=password&scope=openid&client_id=local-id&username=user&password=password' | python -mjson.tool
The same for https://dev.yukaimaps/someware.fr :
curl -s https://dev.yukaimaps.someware.fr/auth/realms/yukaimaps/protocol/openid-connect/token --data 'grant_type=password&scope=openid&client_id=dev.yukaimaps.someware.fr&username=user&password=password' | python -mjson.tool
Example response :
{
"access_token": "eyJhbGciOiJSUzI1NiIsInR5cCIgOiAiSldUIiwia2lkIiA6ICJqSkJwVFBzWENOVHZTZGlqZUd3NEVYbHlLaGxjbmZIU19JV0tva0Z6QU5jIn0.eyJleHAiOjE2Nzg3NTgzNDAsImlhdCI6MTY3ODcyMjM0MCwianRpIjoiZDg3Y2NjMzctZTY3Yy00YzE3LTgyMTItZjdjNGU2YzNiN2Y5IiwiaXNzIjoiaHR0cDovL2xvY2FsaG9zdDozMDMwL3JlYWxtcy95dWthaW1hcHMiLCJhdWQiOiJhY2NvdW50Iiwic3ViIjoiNzkyMGNmMjEtNDZkOS00M2VhLThlMDAtZWJhNjkxYTQ4NjVhIiwidHlwIjoiQmVhcmVyIiwiYXpwIjoibG9jYWwtaWQiLCJzZXNzaW9uX3N0YXRlIjoiYzE2YjY3NzUtMzhjNS00NjljLThjMDItZWRhNDlkM2Q0OWViIiwiYWNyIjoiMSIsImFsbG93ZWQtb3JpZ2lucyI6WyJodHRwOi8vMTI3LjAuMC4xOjgwODAiXSwicmVhbG1fYWNjZXNzIjp7InJvbGVzIjpbIm9mZmxpbmVfYWNjZXNzIiwidW1hX2F1dGhvcml6YXRpb24iLCJkZWZhdWx0LXJvbGVzLXl1a2FpbWFwcyJdfSwicmVzb3VyY2VfYWNjZXNzIjp7ImFjY291bnQiOnsicm9sZXMiOlsibWFuYWdlLWFjY291bnQiLCJtYW5hZ2UtYWN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iJ1c2VyIiwibG9jYWxlIjoiZnIiLCJnaXZlbl9uYW1lIjoiRGVmYXVsdCIsImZhbWlseV9uYW1lIjoiVXNlciIsImVtYWlsIjoidXNlckBleGFtcGxlLmNvbSJ9.VRFR1HYWx_HXm6CUojY44WYkXvRdj6eadH22ElEOsWJ5anm0qJIC4WBSgoGpOXXSvZiaW5t_t7WYHoObVWYzEpyn_DJTJwqcyh3QIuMSyKpcyMA_c-qW9ZhBnoDSA4FEmfX7juouaimSKGmk3d_n7H8b-J9NaKnRQ5ICcoxaHKx1Z6DewMvi9g2IPlzeE9JmlTZZ0GhdQ7CEkhPPSZYnOz_wDJTBoyOIvOmaTopJxuFODnJyXppf6NTbop61xO0KLw-rN1rAfwOvn36cOEO_xX_gFficIUKJfKX_boWzduVt2bvSAhWIiaeoiUNEBOr7uTuFdOFoeo-D2Y8ZDBl_9A",
"not-before-policy": 0,
"session_state": "c16b6775-38c5-469c-8c02-eda49d3d49eb",
"scope": "openid email profile"
}
The access_token attribute can then be used as a password for expires_in seconds.
Edited by Jérôme Thiard