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

Mehrnoosh
Mehrnoosh Member Posts: 36
edited September 2020 in Accounts Hosted
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

Comments

  • Jason Hollis
    Jason Hollis Alumni Posts: 516 Reckon Staff
    edited September 2020
    The team are looking at this today Mehrnoosh.
  • Mehrnoosh
    Mehrnoosh Member Posts: 36
    edited July 2017
    Hi Jason,

    Thanks
  • Ifti
    Ifti Reckon Staff Posts: 258 Reckon Staff
    edited July 2017
    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
  • Jason Hollis
    Jason Hollis Alumni Posts: 516 Reckon Staff
    edited July 2017
    Also, if you do need Implicit Mehrnoosh please send the team an email outlining your use case. 
  • Mehrnoosh
    Mehrnoosh Member Posts: 36
    edited July 2017

    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,

  • Mehrnoosh
    Mehrnoosh Member Posts: 36
    edited July 2018
    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,
  • Ifti
    Ifti Reckon Staff Posts: 258 Reckon Staff
    edited July 2017
    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:
    image

    Please see if it helps.

    Ifti
  • Mehrnoosh
    Mehrnoosh Member Posts: 36
    edited February 2019
    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:
    image

    image
  • Ifti
    Ifti Reckon Staff Posts: 258 Reckon Staff
    edited July 2017
    Ok. I've changed to "Implicit". Can you please try it again?

    Edit: Please make sure you've changed the URL to the below format:

    Sample HTTPS Call (Implicit grant type)
    https://identity.reckon.com/connect/authorize?client_id=<<CLIENT ID>>&response_type=id_token+token&scope=openid+read+write&redirect_uri=http://127.0.0.1/index.html&state=random_state&nonce=random_nonce
  • Mehrnoosh
    Mehrnoosh Member Posts: 36
    edited July 2017
    The same error:
    This is my URL:
    https://identity.reckon.com/connect/authorize?client_id=8b81cbce-c2e0-4ad6-8432-b4364d27a5f8&res...

    I've received code 200 but still, this error shows up in the response body:
    The client application made an invalid request
  • Ifti
    Ifti Reckon Staff Posts: 258 Reckon Staff
    edited July 2017
    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
  • Mehrnoosh
    Mehrnoosh Member Posts: 36
    edited July 2017
    ,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. 
  • Ifti
    Ifti Reckon Staff Posts: 258 Reckon Staff
    edited July 2017
    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

  • Mehrnoosh
    Mehrnoosh Member Posts: 36
    edited July 2017
    Thank you so much.

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

    Best Regards,
  • Ifti
    Ifti Reckon Staff Posts: 258 Reckon Staff
    edited July 2017
    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