By: Sumeen Kaur user 15 Jun 2017 at 3:51 p.m. CDT

8 Responses
Sumeen Kaur gravatar
Hi I am trying to use Moodle as my client and Gluu as the provider. I have installed OpenID Connect plugin in moodle. I manually added an OpenID Client on Gluu with following settings ClientID <clientid>, Client secret <clientsecret>, Application Type as Web, Pre Authorization as True , Subject Type as Public, Authentication method for the token endpoint as client_secret_basic. I added response types as code,id_token, token. I added scopes as openid and profile. I added Grant Types as authorization_code, implicit, refresh_token I have updated the settings on the moodle client and added the Redirect Login URI that the plugin on moodle mentioned on the Gluu Client i created. Technically, they are communicating as I try to login from client moodle, see the glu login page, login successfully and it redirects me to the moodle redirect uri i mentioned above. But the error returned from Gluu is "invalid_client" once it redirects to the uri. I am sure I missing something. Does not look like client issue to me. Is there a way I can see what is the client id on the gluu database registered with secret key? I am suspecting that either client id or client secret is not sent correctly. Any help would be appreciated. Sumeen

By Michael Schwartz Account Admin 15 Jun 2017 at 3:57 p.m. CDT

Michael Schwartz gravatar
1. `response_type` should just be `code` ... `code id_token token` = hybrid flow. I think you want code flow. 2. Also remove `implicit_grant` 3. Make sure `redirect_uri` on Moddle is https To further assist, it would be helpful if you can post anything interesting in the oxauth logs or in your client logs. Also, we have no idea if the Moodle client actually works. What's the url of the client home page.

By Sumeen Kaur user 15 Jun 2017 at 4:05 p.m. CDT

Sumeen Kaur gravatar
Thanks Michael for a quick response. I actually tried all options here. As you mentioned above... 1) I added response type only as code 2) Grant Type only as authorization_code and refresh_token 3) Redirect_URI is https Is there a private channel where I can communicate with you directly and send u the exact request going with the client id or other details. Please let me know. This is really urgent. I checked the oxauth logs and moodle logs. The oxauth logs just says authentication successfull and moodle docs just throws the error. Thanks Sumeen

By Sumeen Kaur user 16 Jun 2017 at 10:02 a.m. CDT

Sumeen Kaur gravatar
Hi Michael I have send you the screenshots of the plugin used as RP on moodle with the settings done, Client settings added in gluu, and oxauth log. Please see the google drive link attached. If you can send us an email with your IP, we can whitelist you and give access to the gluu and moodle urls set up for more details. We are still in development stage and kind of struggling on it. Any help is appreciated. Thanks Sumeen

By Michael Schwartz Account Admin 16 Jun 2017 at 11:09 a.m. CDT

Michael Schwartz gravatar
1. I have no idea what moodle means by "Resource" 2. You may want to use `public` not `pairswise` subject identifier 3. `redirect_uri` looks right 4. The oxauth log that you showed has no error (only INFO) 5. We will not access your system, even if you were to buy commercial support. 6. Is the `redirect_uri` being called? 7. Are you sure Moodle supports form-post response type?

By Sumeen Kaur user 16 Jun 2017 at 11:18 a.m. CDT

Sumeen Kaur gravatar
Thanks Michael for the response. Point 2 - I tried both public and 'pairwise' subject identifier. Point 6 - Yes, the redirect_uri is being called and sent as a post request and thats where it threw a 404 error with the response error message of 'invalid_client'. I will investigate on the other points and get back to you with more details. Thanks Sumeen

By Michael Schwartz Account Admin 16 Jun 2017 at 11:21 a.m. CDT

Michael Schwartz gravatar
The Gluu Server throws invalid client? Or the application?

By Sumeen Kaur user 16 Jun 2017 at 11:41 a.m. CDT

Sumeen Kaur gravatar
Looks Gluu server to me. I am sure I am missing something here. I attached two more screenshots - network trace 1 and 2 in the same link as above. The plugin on the client side is PHP. So all I did is just print the json response I get back from the last redirect uri request sent as POST request from the client and exit the program. The program if not exited throws an exception as 404 with a web page which is plugin related. This is the printed response : Array ( [error] => invalid_client [error_description] => Client authentication failed (e.g. unknown client, no client authentication included, or unsupported authentication method). The authorization server MAY return an HTTP 401 (Unauthorized) status code to indicate which HTTP authentication schemes are supported. If the client attempted to authenticate via the Authorization request header field, the authorization server MUST respond with an HTTP 401 (Unauthorized) status code, and include the WWW-Authenticate response header field matching the authentication scheme used by the client. ) Also, point 1) I have no idea what moodle means by "Resource"- the tooltip on it says - "The OpenID Connect resource for which to send the request.". Does that give any idea? Again, I appreciate your help on this. Thanks Sumeen

By Sahil Arora user 17 Jul 2017 at 4:55 p.m. CDT

Sahil Arora gravatar
Hi Sumeen, I wanted to follow up with you on this.Please let us know if issue was resolved? If not, Can you please inform if you see error from Gluu side or application side? Do you see user authentication successful in oxauth logs?