The client application made an invalid request error in Identity server for implicit grant type

  • 1
  • Question
  • Updated 1 year ago
  • Answered
Hi Guys,

I  have struggled to get the access token from identity server by calling the following url:
https://identity.reckon.com/connect/authorize?client_id=8b81cbce-c2e0-4ad6-8432-b4364d27a5f8&res...

I've tried it by Postman and WSO2 ESB and also hit it through the browser, I've received  the same error:
The client application made an invalid request error.

When I changed the redirect url to something else (i.e add http:// at start), the error is changed to "The client application is not known or is not authorized."

I checked my application permission for identity server from here:https://identity.reckon.com/permissions
 
This is "Implicit ClientsResource Permissions

Read dataWrite data"
This is the payload factory which I send to this endpoint "https://identity.reckon.com/connect/authorize"

Payload:  
{ "client_id": "8b81cbce-c2e0-4ad6-8432-b4364d27a5f8", "grant_type": "implicit", "response_type": "id_token+token", "scope": "openid+read+write", "redirect_uri": "symphony3devau.com";, "state": "random_state", "nonce": "random_nonce" } 

I've tried to get access token through the AZURE portal and it works, but the access token is expired after a couple of hours, so I cannot hardcode it in my application.

Could you please guide me how to fix it?

I really appreciate your help
Photo of Mehrnoosh

Mehrnoosh

  • 730 Points 500 badge 2x thumb

Posted 1 year ago

  • 1
Photo of Jason Hollis

Jason Hollis, Head of Product

  • 9,614 Points 5k badge 2x thumb
The team are looking at this today Mehrnoosh.
Photo of Mehrnoosh

Mehrnoosh

  • 730 Points 500 badge 2x thumb
Hi Jason,

Thanks
Photo of Ifti

Ifti, Product Manager

  • 6,236 Points 5k badge 2x thumb
HI Mehrnoosh,

Thank you for your post.

The reason why you're getting this error is because your account is set for "Authorization Code".

Please choose that as your authorisation method and follow the instructions from the below article that tells you how to obtain code via this method.
https://reckon.helpdocsonline.com/reckon-api-authorisation-services

Hope this helps.

Ifti
Reckon API Team
Photo of Jason Hollis

Jason Hollis, Head of Product

  • 9,614 Points 5k badge 2x thumb
Also, if you do need Implicit Mehrnoosh please send the team an email outlining your use case. 
Photo of Mehrnoosh

Mehrnoosh

  • 730 Points 500 badge 2x thumb
Hi Ifti,

Thanks for your prompt reply.

I've tried the Authorization code as well, Once I try it through the Azure portal, I've received this error:
The client application is not known or is not authorized.
Azure Portal works only for implicit for my account. I sign in to the Azure portal with this account: fcoleman@symphony3.com

When I test this one with Postman or WSO2 ESB, I've received this error:
The client application made an invalid request.
my endpoint:
https://identity.reckon.com/connect/authorize

Payload :
{ "client_id": "8b81cbce-c2e0-4ad6-8432-b4364d27a5f8", "response_type": "code", "scope": "openid+read+write+offline_access", "redirect_uri": "symphony3devau.com", "state": "random_state", "nonce": "random_nonce" } 

Header=
Authorization: Basic OGI4MWNiY2UtYzJlMC00YWQ2LTg0MzItYjQzNjRkMjdhNWY4

Thanks,
Photo of Ifti

Ifti, Product Manager

  • 6,236 Points 5k badge 2x thumb
Hi Mehrnoosh,

I've just tested it with Postman and I received a 200 OK response. I can't see the response code in the URL as the callback url should get the response back.

Please make sure you're passing through the "Params" with the URL and add client ID etc. in that.

Example shot:


Please see if it helps.

Ifti
Photo of Mehrnoosh

Mehrnoosh

  • 730 Points 500 badge 2x thumb
Hi Jason,


Actually, I prefer to have a static token to use it in my code. Because I use a middleware (WSO2 ESB) to integrate our CRM system to Reckon and I'm not sure about this middleware to could handle it. Is it possible at all?

Thanks,
Photo of Mehrnoosh

Mehrnoosh

  • 730 Points 500 badge 2x thumb
Thanks.

I've received this  200 OK  as well but in the body of response an error instead of code?

I've attached my request and error:


Photo of Ifti

Ifti, Product Manager

  • 6,204 Points 5k badge 2x thumb
Hi Mehrnoosh,

Figured out the problem.

In your url to get the code back, you had "url" instead of "uri" (universal resource indicator)" <"redirect_url" instead of "redirect_uri">.

Please rename that part and it should work.

Ifti
Photo of Mehrnoosh

Mehrnoosh

  • 730 Points 500 badge 2x thumb
,Ifti
Thanks, 
 
I really appreciate your help. It was a silly mistake by me. I changed it to redirect_uri but it doesn't work. the same error shows up. 
Photo of Ifti

Ifti, Product Manager

  • 6,204 Points 5k badge 2x thumb
Hi Mehrnoosh,

I was about to give you the updated URL. You didn't have Https:// in the url. We need that one in the call back URL.

Please try with the below URL and it should work:
https://identity.reckon.com/connect/authorize?client_id=8b81cbce-c2e0-4ad6-8432-b4364d27a5f8&res...

Thanks

Ifti
Photo of Mehrnoosh

Mehrnoosh

  • 730 Points 500 badge 2x thumb
Thank you so much.

It works now:) I really appreciate your patience and your support

Best Regards,
Photo of Ifti

Ifti, Product Manager

  • 6,204 Points 5k badge 2x thumb
That's great to hear!

Just FYI: You could use Implicit within Azure portal because that only works in Implcit mode. It doesn't take client ID and secret into consideration.

Happy coding :)

Ifti