Skip to main content
Question

Access token isn't working


Forum|alt.badge.img+2

Hi,

I’m trying to get the warehouse inventory list using a bearer token, I’m using ‘IFS Database’ as an identity provider.

I got my access token like this :

Then I used it like this :

 

But I’m getting a 401 error, I tried to use the id_token instead of the access_token but I get the same thing.

Am I missing something?

Thanks.

8 replies

Srikanth
Superhero (Partner)
Forum|alt.badge.img+18
  • Superhero (Partner)
  • 291 replies
  • April 17, 2020

Hi,

Will this connect flow diagram help you in narrowing down the possible cause for the 401 error?

 


paul.phillips
Do Gooder (Partner)
Forum|alt.badge.img+5
  • Do Gooder (Partner)
  • 22 replies
  • April 17, 2020

Capitalize the B in bearer and use the id_token. 


Forum|alt.badge.img+2
  • Author
  • Do Gooder
  • 1 reply
  • April 17, 2020

With “Beared <Id_token> I get in the response a 401 and this in the header :

error="invalid_token", error_description="87f52886-8207-434e-878e-2160666616ed: The audience claims of the provided id token indicates that this is not an intended recipient."

 

I cannot request : /main/ifsapplications/projection/v1/CountReportsAnalysis.svc/CountingReports ?


Forum|alt.badge.img+9
  • Sidekick (Partner)
  • 59 replies
  • December 20, 2020

@alexis Did you manage to resolve this issue… I’m facing the same issue right now


hhy38
Superhero (Customer)
Forum|alt.badge.img+16
  • Superhero (Customer)
  • 318 replies
  • December 21, 2020

Hi,

 

I think the problem with Authorization. Try these steps. for more detail, you can check the @dsj tip from the link.  → Tip

 

Set Auth Header

  • Go to the Auth Tab,
  • Select Type as Basic Auth
  • Type IFS username and password to be used for the integration

Regards,

Hasan


Björn Kihlström
Do Gooder (Former Employee)
Forum|alt.badge.img+3

Hello.

Judging by the screenshots provided in the post, I can see two things.

  1. The resource parameter in the token request is shorter than the client IDs. That’s not how it’s supposed to be. The correct value for a resource parameter is the same as the web client ID for database authentication.
  2. The access token you get is not a JWT token. This is consistent with what you would expect from a faulty resource parameter being used. 

Correct the resource parameter and I believe your token request should work and yield a good access token.

The ID token is also a JWT but it shouldn’t (can’t) be used like this.

Best regards, Björn.


dsj
Superhero (Partner)
Forum|alt.badge.img+22
  • Superhero (Partner)
  • 824 replies
  • January 8, 2021

Hi @alexis,

 

In Postman you can obtain the OAuth token directly. I’ve done it and worked fine. Only thing is you need to use the ID token instead of Access token.

I wrote a small blog post about how to do it. may be it will guide you to get it work :)

https://dsj23.me/2021/01/08/ifs-authentication-flow-with-oauth-and-openid-connect/

 

Cheers!
Damith

 


Forum|alt.badge.img+6
  • Do Gooder (Customer)
  • 16 replies
  • January 16, 2025

Hello ​@dsj 

 

I can get a token and when I use that or the id token, no matter what I do, I still get a 401- 

 

Rage!

 

Thanks

Ross

 

 


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings