Issue with API Integration

Hi ,

I am trying to do integration of Okta with Web API. API is in .Net framework 4.x.

I have got sample token from Postman and got the sample api integration project, but I am unauthorized - 401 response for calling API calls.

I have set OktaDomain in Web.config, which is issuer link. Any help will be really helpful with my implementation.

Thanks,
Pratik

Do you have any further details about the 401 you are seeing? Is this one of your resource server’s endpoints returning the 401 when a request is made with an access token for authorization?

Hi Andrea,

Thanks for you reply. I have downloaded sample web API project from Okta website for integration with .net framework 4.x Web API.

Also I have created one test Okta App from my developer login, that app is working fine authentication and authenticates using token from postman.

Token from my app

image
Response from Okta:-

But when I try with my client’s Okta App integration not working and gives me 401 unauthorized message. I am able to get token from my client’s app using postman, But using that token sample API does not work.

API token from Client Okta App:-

image

Response from Call using token:-

Thanks,
Pratik

What issuer are you using (both to get the token and to validate it on the resource server)?

Hi Andrea,

Thanks for you response. My issue is resolved now. My client Okta app needs to add default authorisation policy for App and that resolved my issue. Now working fine authorisation with my client app.

Thanks,
Pratik

1 Like

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.