amazon-archives / amazon-cognito-auth-js

The Amazon Cognito Auth SDK for JavaScript simplifies adding sign-up, sign-in with user profile functionality to web apps.
Apache License 2.0
422 stars 231 forks source link

OpenID integration with Azure AD #136

Open konstantinvlasenko opened 6 years ago

konstantinvlasenko commented 6 years ago

Hi everyone,

Trying to use OpenID IDp integration. My IDp is Azure AD.

Seems like Microsoft returns a successful response. But I am being redirect to https://myapp.com?error_description=java.util.ArrayList+cannot+be+cast+to+java.lang.String&state=g6JcAH9BBw6MDjm0AvGz31yXWTJg82KL&error=invalid_request by https://myapp.auth.us-east-1.amazoncognito.com/oauth2/idpresponse?code=AQABAAIAAADX.............

Any idea what I am doing wrong?

Update: after successful Authorization Response from Idp. Amazon is not trying to do an Access Token Request, but fails with error above. It looks, like it can't handle a code value for some reasons.

Thank you!

feelgoodman commented 6 years ago

Experiencing the same issue. Azure AD authentication works, then redirects to: https://my-web-app.eu-west-2.amazoncognito.com/oauth2/idpresponse?code=&session_state=748e396f-d62c-4e1b-91f3-6d0038fee837

But Cognito, just redirects to: https://my-web-app-url?error_description=java.util.ArrayList+cannot+be+cast+to+java.lang.String&state=LhpwRxnDTx7SHpKXetjrFBfMTkuuY6jH&error=invalid_request

(As an aside; Can't AWS add an 'out-of-the-box' integration with Azure, as you have for facebook, etc? I appreciate that Azure is a competitor - but is ubiquitous for corporate directories. There is talk about moving everything to Azure due to the difficulties in using Azure AD to authenticate with AWS.)