By: Sakit Atakishiyev user 30 Oct 2017 at 9:16 a.m. CDT

13 Responses
Sakit Atakishiyev gravatar
Hi. I could not obtain token from token endpoint. I am using Postman for testing the webservices This is the my request content ``` POST /oxauth/restv1/token HTTP/1.1 Host: login.cybernet.az Content-Type: application/x-www-form-urlencoded Authorization: Basic QCE3ODM1LjY1M0IuMzRGOS45Mjk1ITAwMDEhOTlCRS4xQTU4ITAwMDghQjVBRi44ODVBLjlBMEQuRkEyNDpzZWNyZXQ= Cache-Control: no-cache Postman-Token: 58db42a2-b4bd-8b3f-da37-3591f370ad46 grant_type=authorization_code&scope=openid%2Buma_protection&code=80587192-5903-45ac-afcd-60ecf5dc1aa1&redirect_uri=https%3A%2F%2Fgoogle.com ``` And gluu server response ``` { "error": "invalid_request", "error_description": "The request is missing a required parameter, includes an unsupported parameter or parameter value, repeats a parameter, includes multiple credentials, utilizes more than one mechanism for authenticating the client, or is otherwise malformed." } ``` And this is the `oxauth.log` ``` 2017-10-30 14:21:59,485 TRACE [qtp2008017533-16] [org.xdi.oxauth.auth.Authenticator] (Authenticator.java:149) - Authentication successfully for '@!7835.653B.34F9.9295!0001!99BE.1A58!0008!B5AF.885A.9A0D.FA24' 2017-10-30 14:21:59,493 DEBUG [qtp2008017533-16] [xdi.oxauth.token.ws.rs.TokenRestWebServiceImpl] (TokenRestWebServiceImpl.java:98) - Attempting to request access token: grantType = null, code = null, redirectUri = null, username = null, refreshToken = null, clientId = null, ExtraParams = {}, isSecure = true, codeVerifier = null, ticket = null 2017-10-30 14:21:59,493 DEBUG [qtp2008017533-16] [xdi.oxauth.token.ws.rs.TokenRestWebServiceImpl] (TokenRestWebServiceImpl.java:118) - Starting to validate request parameters 2017-10-30 14:21:59,494 TRACE [qtp2008017533-16] [xdi.oxauth.token.ws.rs.TokenRestWebServiceImpl] (TokenRestWebServiceImpl.java:121) - Failed to validate request parameters 2017-10-30 14:21:59,494 DEBUG [qtp2008017533-16] [org.xdi.oxauth.model.error.ErrorResponseFactory] (ErrorResponseFactory.java:70) - Looking for the error with id: invalid_request 2017-10-30 14:21:59,495 DEBUG [qtp2008017533-16] [org.xdi.oxauth.model.error.ErrorResponseFactory] (ErrorResponseFactory.java:75) - Found error, id: invalid_request ```

By Aliaksandr Samuseu staff 30 Oct 2017 at 10:54 a.m. CDT

Aliaksandr Samuseu gravatar
Hi, Sakit. According to [this statement](https://www.gluu.org/blog/limiting-openid-connect-community-client-support/) we don't provide support for flows using OIDC clients except mentioned in the list, including development of custom clients or issuing custom requests with tools like curl or postman etc. This implies you are familiar with the protocol enough to troubleshoot it yourself. If you believe that oxAuth's behavior deviates from [the spec](http://openid.net/specs/openid-connect-core-1_0.html), please point out how and corresponding spec's section stating it should behave differently.

By Michael Schwartz Account Admin 30 Oct 2017 at 12:42 p.m. CDT

Michael Schwartz gravatar
Alex, agreed.

By Sakit Atakishiyev user 30 Oct 2017 at 1:02 p.m. CDT

Sakit Atakishiyev gravatar
Hi Aliaksandr thanks for you reply. I know that you have limited resources. Actually after I created this ticket I tried with different tool and everyhting is ok. Until `gluu-server 3.1.0` I used postman when testing the gluu webservices. For example with `gluu-server 3.01` postman works normaly.

By Michael Schwartz Account Admin 30 Oct 2017 at 1:05 p.m. CDT

Michael Schwartz gravatar
Gluu Server 3.1.1 is self-certified with OpenID Connect test suite. Not sure exactly what the issue is, but let us know if you figure it out.

By Aliaksandr Samuseu staff 30 Oct 2017 at 1:52 p.m. CDT

Aliaksandr Samuseu gravatar
> Until gluu-server 3.1.0 I used postman when testing the gluu webservices. For example with gluu-server 3.01 postman works normaly. It hardly has to do something with Postman, OIDC uses quite simple request formats for basic flows, so it's not a protocol where you can easily overlook some syntax mistake. If you do it right (and the core spec contains good examples of correct requests) you should make it work. If you suspect something may be out of order here, I would suggest to compare requests you send to 3.0.1 (where it works for you, if I got it right), and for 3.1.x, see whether there are differences. If there are some, check which variant is closer to the spec.

By Michael Schwartz Account Admin 30 Oct 2017 at 3:05 p.m. CDT

Michael Schwartz gravatar
Sakit is saying that his request is the same. It is entirely possible that the Gluu Server is more strict in some area in 3.1.x

By Aliaksandr Samuseu staff 30 Oct 2017 at 3:40 p.m. CDT

Aliaksandr Samuseu gravatar
It's also possible that client's metadata wasn't configured the same way in the newer instance, this also should be compared with the previous setup.

By Sakit Atakishiyev user 30 Oct 2017 at 9:51 p.m. CDT

Sakit Atakishiyev gravatar
Hi Aliaksandr Michael is right, I use the same request for both version `3.0.1` and `3.1.0`. For configured metada I use the default which comes with installation. But I got this problem when I try to obtain token. For example I can register any client with postman. Getting the information about client and etc. But when I call the `/oxauth/restv1/token` I got `invalid request error` because of `grant_type` is `null` as you can see from the `oxauth.log`. But not only `grant_type` also other parameters were null. And I used the same request with the different web service tool and everything work normally and I obtained token. I will post to here if I found the problem

By Sakit Atakishiyev user 02 Nov 2017 at 10:42 a.m. CDT

Sakit Atakishiyev gravatar
version `3.1.1` is ok with postman

By William Lowe user 02 Nov 2017 at 12:10 p.m. CDT

William Lowe gravatar
Great to hear. Thanks for confirmation.

By Yamil Díaz Aguirre user 24 Jan 2019 at 4:35 p.m. CST

Yamil Díaz Aguirre gravatar
Hi guys, I have exactly the same issue, but this time with 3.1.5 gluu version. This is the route that I'm requesting: ``` https://gluu/oxauth/restv1/token?grant_type=authorization_code&code=e7d82ecb-260e-4d07-8603-9af28c895058&redirect_uri=https%3A%2F%2Fgluu.org ``` I'm including also the Authorization header with my client_id and client_secret separated by ":". This is my oxauth.log ``` 2019-01-24 22:30:31,235 TRACE [qtp804611486-15] [org.xdi.oxauth.auth.AuthenticationFilter] (AuthenticationFilter.java:91) - Get request to: 'https://gluu.gluu/oxauth/restv1/token' 2019-01-24 22:30:31,235 DEBUG [qtp804611486-15] [org.xdi.oxauth.auth.AuthenticationFilter] (AuthenticationFilter.java:98) - Starting token endpoint authentication 2019-01-24 22:30:31,235 DEBUG [qtp804611486-15] [org.xdi.oxauth.auth.AuthenticationFilter] (AuthenticationFilter.java:111) - Starting Basic Auth token endpoint authentication 2019-01-24 22:30:31,239 DEBUG [qtp804611486-15] [org.xdi.oxauth.service.ClientService] (ClientService.java:141) - Found 1 entries for client id = @!ABAB.BBCE.829C.6D10!0001!97B6.D53A!0008!4AB2.1A47.E6CA.9C30 2019-01-24 22:30:31,239 TRACE [qtp804611486-15] [org.xdi.oxauth.auth.Authenticator] (Authenticator.java:181) - Authenticating ... (interactive: false, skipPassword: false, credentials.username: @!ABAB.BBCE.829C.6D10!0001!97B6.D53A!0008!4AB2.1A47.E6CA.9C30) 2019-01-24 22:30:31,240 DEBUG [qtp804611486-15] [org.xdi.oxauth.service.ClientService] (ClientService.java:101) - Authenticating Client with LDAP: clientId = @!ABAB.BBCE.829C.6D10!0001!97B6.D53A!0008!4AB2.1A47.E6CA.9C30 2019-01-24 22:30:31,240 TRACE [qtp804611486-15] [org.xdi.oxauth.service.ClientService] (ClientService.java:199) - Get client from cache by Dn 'inum=@!ABAB.BBCE.829C.6D10!0001!97B6.D53A!0008!4AB2.1A47.E6CA.9C30,ou=clients,o=@!ABAB.BBCE.829C.6D10!0001!97B6.D53A,o=gluu' 2019-01-24 22:30:31,240 DEBUG [qtp804611486-15] [org.xdi.oxauth.service.ClientService] (ClientService.java:141) - Found 1 entries for client id = @!ABAB.BBCE.829C.6D10!0001!97B6.D53A!0008!4AB2.1A47.E6CA.9C30 2019-01-24 22:30:31,240 DEBUG [qtp804611486-15] [org.xdi.oxauth.service.AuthenticationService] (AuthenticationService.java:515) - ConfigureSessionClient: username: '@!ABAB.BBCE.829C.6D10!0001!97B6.D53A!0008!4AB2.1A47.E6CA.9C30', credentials: '96384138' 2019-01-24 22:30:31,240 TRACE [qtp804611486-15] [org.xdi.oxauth.service.ClientService] (ClientService.java:199) - Get client from cache by Dn 'inum=@!ABAB.BBCE.829C.6D10!0001!97B6.D53A!0008!4AB2.1A47.E6CA.9C30,ou=clients,o=@!ABAB.BBCE.829C.6D10!0001!97B6.D53A,o=gluu' 2019-01-24 22:30:31,240 DEBUG [qtp804611486-15] [org.xdi.oxauth.service.ClientService] (ClientService.java:141) - Found 1 entries for client id = @!ABAB.BBCE.829C.6D10!0001!97B6.D53A!0008!4AB2.1A47.E6CA.9C30 2019-01-24 22:30:31,247 INFO [qtp804611486-15] [org.xdi.oxauth.auth.Authenticator] (Authenticator.java:262) - Authentication success for Client: '@!ABAB.BBCE.829C.6D10!0001!97B6.D53A!0008!4AB2.1A47.E6CA.9C30' 2019-01-24 22:30:31,247 TRACE [qtp804611486-15] [org.xdi.oxauth.auth.Authenticator] (Authenticator.java:205) - Authentication successfully for '@!ABAB.BBCE.829C.6D10!0001!97B6.D53A!0008!4AB2.1A47.E6CA.9C30' 2019-01-24 22:30:31,250 DEBUG [qtp804611486-15] [org.xdi.oxauth.service.ClientService] (ClientService.java:141) - Found 1 entries for client id = @!ABAB.BBCE.829C.6D10!0001!97B6.D53A!0008!4AB2.1A47.E6CA.9C30 2019-01-24 22:30:31,252 DEBUG [qtp804611486-15] [xdi.oxauth.token.ws.rs.TokenRestWebServiceImpl] (TokenRestWebServiceImpl.java:107) - Attempting to request access token: grantType = null, code = null, redirectUri = null, username = null, refreshToken = null, clientId = null, ExtraParams = {grant_type=[authorization_code], code=[e7d82ecb-260e-4d07-8603-9af28c895058], redirect_uri=[https://gluu]}, isSecure = true, codeVerifier = null, ticket = null 2019-01-24 22:30:31,252 DEBUG [qtp804611486-15] [xdi.oxauth.token.ws.rs.TokenRestWebServiceImpl] (TokenRestWebServiceImpl.java:129) - Starting to validate request parameters 2019-01-24 22:30:31,252 TRACE [qtp804611486-15] [xdi.oxauth.token.ws.rs.TokenRestWebServiceImpl] (TokenRestWebServiceImpl.java:132) - Failed to validate request parameters 2019-01-24 22:30:31,252 DEBUG [qtp804611486-15] [org.xdi.oxauth.model.error.ErrorResponseFactory] (ErrorResponseFactory.java:70) - Looking for the error with id: invalid_request 2019-01-24 22:30:31,253 DEBUG [qtp804611486-15] [org.xdi.oxauth.model.error.ErrorResponseFactory] (ErrorResponseFactory.java:75) - Found error, id: invalid_request 2019-01-24 22:30:32,652 DEBUG [oxAuthScheduler_Worker-5] [org.xdi.service.timer.RequestJobListener] (RequestJobListener.java:52) - Bound request started 2019-01-24 22:30:32,652 DEBUG [oxAuthScheduler_Worker-5] [org.xdi.service.timer.TimerJob] (TimerJob.java:34) - Fire timer event [org.xdi.service.cdi.event.LoggerUpdateEvent] with qualifiers [@org.xdi.service.cdi.event.Scheduled()] 2019-01-24 22:30:32,652 DEBUG [oxAuthScheduler_Worker-5] [org.xdi.service.timer.RequestJobListener] (RequestJobListener.java:62) - Bound request ended 2019-01-24 22:30:47,645 DEBUG [oxAuthScheduler_Worker-1] [org.xdi.service.timer.RequestJobListener] (RequestJobListener.java:52) - Bound request started 2019-01-24 22:30:47,645 DEBUG [oxAuthScheduler_Worker-1] [org.xdi.service.timer.TimerJob] (TimerJob.java:34) - Fire timer event [org.xdi.service.cdi.event.ConfigurationEvent] with qualifiers [@org.xdi.service.cdi.event.Scheduled()] 2019-01-24 22:30:47,646 DEBUG [oxAuthScheduler_Worker-1] [org.xdi.service.timer.RequestJobListener] (RequestJobListener.java:62) - Bound request ended 2019-01-24 22:30:47,651 DEBUG [oxAuthScheduler_Worker-2] [org.xdi.service.timer.RequestJobListener] (RequestJobListener.java:52) - Bound request started 2019-01-24 22:30:47,651 DEBUG [oxAuthScheduler_Worker-2] [org.xdi.service.timer.TimerJob] (TimerJob.java:34) - Fire timer event [org.xdi.service.cdi.event.LoggerUpdateEvent] with qualifiers [@org.xdi.service.cdi.event.Scheduled()] 2019-01-24 22:30:47,652 DEBUG [oxAuthScheduler_Worker-2] [org.xdi.service.timer.RequestJobListener] (RequestJobListener.java:62) - Bound request ended 2019-01-24 22:30:47,661 DEBUG [oxAuthScheduler_Worker-3] [org.xdi.service.timer.RequestJobListener] (RequestJobListener.java:52) - Bound request started 2019-01-24 22:30:47,662 DEBUG [oxAuthScheduler_Worker-3] [org.xdi.service.timer.TimerJob] (TimerJob.java:34) - Fire timer event [org.xdi.service.cdi.event.LdapStatusEvent] with qualifiers [@org.xdi.service.cdi.event.Scheduled()] 2019-01-24 22:30:47,662 DEBUG [oxAuthScheduler_Worker-3] [org.xdi.service.timer.RequestJobListener] (RequestJobListener.java:62) - Bound request ended 2019-01-24 22:30:47,727 DEBUG [oxAuthScheduler_Worker-4] [org.xdi.service.timer.RequestJobListener] (RequestJobListener.java:52) - Bound request started 2019-01-24 22:30:47,727 DEBUG [oxAuthScheduler_Worker-4] [org.xdi.service.timer.TimerJob] (TimerJob.java:34) - Fire timer event [org.xdi.oxauth.service.cdi.event.AuthConfigurationEvent] with qualifiers [@org.xdi.service.cdi.event.Scheduled()] 2019-01-24 22:30:47,727 DEBUG [oxAuthScheduler_Worker-4] [org.xdi.service.timer.RequestJobListener] (RequestJobListener.java:62) - Bound request ended 2019-01-24 22:30:47,727 TRACE [ForkJoinPool.commonPool-worker-3] [org.xdi.oxauth.service.AppInitializer] (AppInitializer.java:282) - Attempting to use ldapEntryManager: org.gluu.site.ldap.OperationsFacade@bd10696 2019-01-24 22:30:48,856 DEBUG [oxAuthScheduler_Worker-5] [org.xdi.service.timer.RequestJobListener] (RequestJobListener.java:52) - Bound request started 2019-01-24 22:30:48,856 DEBUG [oxAuthScheduler_Worker-5] [org.xdi.service.timer.TimerJob] (TimerJob.java:34) - Fire timer event [org.xdi.service.cdi.event.UpdateScriptEvent] with qualifiers [@org.xdi.service.cdi.event.Scheduled()] 2019-01-24 22:30:48,880 DEBUG [oxAuthScheduler_Worker-5] [org.xdi.service.timer.RequestJobListener] (RequestJobListener.java:62) - Bound request ended ``` Can somebody help me? Thank you!

By Michael Schwartz Account Admin 27 Jan 2019 at 3:53 a.m. CST

Michael Schwartz gravatar
Yamil, you probably have not properly encoded the parameters or basic client creds. Also, I would suggest using an openid connect client, instead of writing your own low level openid connect code. Have you looked at the [oxd](https://oxd.gluu.org) middleware server. It provides easier to use API's that do some of the openid heavy lifting for you.

By Yamil Díaz Aguirre user 11 Feb 2019 at 8:48 p.m. CST

Yamil Díaz Aguirre gravatar
Thank you very much @Michael.Schwartz!