ForgeRock / openam-community-edition

Access Management - AuthN, AuthZ, SSO, Fedaration
https://forgerock.github.io/openam-community-edition/
124 stars 60 forks source link

Authentication failed for google OAuth2 configuration #55

Open rahogata opened 6 years ago

rahogata commented 6 years ago

Getting authentication failure from openam on successful authentication from Google.

Steps to reproduce:

  1. Add OAuth2 authentication module with Google client details like client id, secret etc.
  2. Add a service with name google and add the above created instance.
  3. In browser go to url http://:8080/openam?service=google
  4. You will be redirected to Google login page.
  5. Login to google and you will be redirected to authentication failure page of openam.

Cause found: In OAuth.java query parameters are included while constructing URL and Google is rejecting the request. Response message is missing parameter grant_type