MAIF / izanami

Izanami is a centralized versatile feature flag solution, well suited for micro service architectures.
https://maif.github.io/izanami/
Apache License 2.0
189 stars 43 forks source link

OAuth2 with Google : Invalid parameter value for claims #671

Closed olivierboudet closed 1 year ago

olivierboudet commented 2 years ago

When trying to use Google OAuth2, an error is raised by Google on authorize endpoint call.

I am running izanami with docker :

docker run -p "8080:8080" -e "OAUTH2_ENABLED=true" -e "OAUTH2_AUTHORIZE_URL=https://accounts.google.com/o/oauth2/auth" -e "OAUTH2_TOKEN_URL=https://oauth2.googleapis.com/token" -e "OAUTH2_CLIENT_ID=xxx.apps.googleusercontent.com" -e "OAUTH2_CLIENT_SECRET=XXXXXXXXXXXXXXXX" -e "OAUTH2_LOGIN_URL=https://accounts.google.com/o/oauth2/auth" -e "OAUTH2_USER_INFO_URL=https://www.googleapis.com/oauth2/v3/userinfo" maif/izanami

When trying to login, I am redirect to https://accounts.google.com/o/oauth2/auth?scope=openid%20profile%20email%20name%20admin%20authorizedPatterns&&claims=email%20name&client_id=xxx.apps.googleusercontent.com&response_type=code&redirect_uri=http://localhost:8080/api/auth/callback?desc=izanami

Google OAuth2 fails with :

Erreur 400 : invalid_request
Invalid parameter value for claims: Invalid claims: com.google.gson.JsonSyntaxException: com.google.gson.stream.MalformedJsonException: Use JsonReader.setLenient(true) to accept malformed JSON at line 1 column 8 path $

It seems the claims parameter is not allowed by Google.