2

I'm attempting to use http://code.google.com/p/gwt-oauth2/ to connect to Azure AD. I know I have the url & client ID (and I added the ability to add a response type and state to the outgoing URL) set correctly because I connected and got an authorization failure for my app, talked with the admins, got them to authorize my app, and now connect through.

The problem is that I get the error message "Could not find access_token in hash", followed by a completely empty hash, with the AD connect.

Google connect works just fine. For Azure AD I'm using "code" as the response_type and "oauth2" (I've also tried "openid", no difference) as the scope

Greg Dougherty
  • 3,281
  • 8
  • 35
  • 58
  • Based on my understanding, the token in the authorization code flow is returned by the token request on the service-side code. It should not be in the hash. Can you use the Fiddler to whether the token request is responded successfully? You can refer [this link](https://learn.microsoft.com/en-us/azure/active-directory/develop/active-directory-protocols-oauth-code) about the authorization flow for Azure AD. – Fei Xue Aug 22 '17 at 07:15
  • @FeiXue Yeah, AzureAD is returning a code, the google client side code just isn't seeing it. I changed the redirect URL so it goes to my server side code, and I'm processing it there – Greg Dougherty Aug 22 '17 at 19:34
  • The gwt-oauth2 seems a library for client-side application(refer [this link](https://stackoverflow.com/questions/3966856/how-do-i-use-oauth-within-my-gwt-application)). If you were developing a client-side application, we should use the [implicit grant flow](https://learn.microsoft.com/en-us/azure/active-directory/develop/active-directory-dev-understanding-oauth2-implicit-grant). If not you may also check the **scribejava** library in previews link to see whether it is helpful. – Fei Xue Aug 23 '17 at 06:34
  • @FeiXue I made a few changes to the code, and now it plays well with server side connection (which I prefer to implicit grant flow, since the server needs to call the Graph API to get more information about the current user). I'm looking to see if I can add my changes to one of the repositories – Greg Dougherty Aug 31 '17 at 23:17

0 Answers0