Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support Bearer method for Service Apps #427

Open
cyrilchapon opened this issue Nov 12, 2024 · 0 comments
Open

Support Bearer method for Service Apps #427

cyrilchapon opened this issue Nov 12, 2024 · 0 comments

Comments

@cyrilchapon
Copy link

Describe the feature request?

Hi, I'm trying and use okta-sdk-nodejs from a Service App which is a cronjob linked to a well-configured service app.

I followed this documentation : https://developer.okta.com/docs/guides/build-api-integration/main/

I took time to entirely setup the flow so I have a full working credentials-saving flow, such as I'm now able to base my requests by :

  • Customer org domain
  • Connected app client_id and client_secret

Still following the aforementionned docs, I'm able to produce scoped access_tokens with a raw client_credentials flow.

I'm now at the step where I want to use the Okta API.

I tried and use oktaClient.userApi.listUsers(), but I got a

[OktaApiError: Okta HTTP 401 E0000011 Invalid token provided. ]

Logging the headers, I saw that the SDK is trying to use my access_token as a SSWS :

{
  Authorization: 'SSWS eyXXXXXXXXXXXXXXXXXXXXX',
  'User-Agent': '@okta/okta-sdk-nodejs/7.1.1 node/18.18.0 darwin/23.5.0',
  Accept: 'application/json, */*;q=0.8'
}

I went and naively tried authorizationMode: 'Bearer' without success and got

Unknown Authorization Mode

Is there a way to use a raw Bearer from a service app style client_credentials ?

New or Affected Resource(s)

Main okta client and options.

Provide a documentation link

https://developer.okta.com/docs/guides/build-api-integration/main

Additional Information?

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant