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

use cURL for protected endpoint #86

Open
pinpom opened this issue Jun 22, 2020 · 1 comment
Open

use cURL for protected endpoint #86

pinpom opened this issue Jun 22, 2020 · 1 comment

Comments

@pinpom
Copy link

pinpom commented Jun 22, 2020

regarding your "sample-web-server.js" for okta-hosted login, if i want to send cURL request to your protected endpoint (the /profile endpoint), do i need access token & then include it as Authentication Bearer token inside cURL request? or what kind of token do I need?

@swiftone
Copy link
Contributor

swiftone commented Aug 3, 2020

The main server is written with the assumption that you are serving browser clients - it relies on the browser to obtain the token and save it to the browser, which can then use the token both in handling requests for web pages as well as passing along to backend servers.

It sounds like you are interested in the backend server portion ( "resource server" in OIDC terminology) - for an example of that, see https://github.com/okta/samples-nodejs-express-4/blob/master/resource-server/server.js

In this case, the token is sent as a header (authorization) with the value Bearer TOKEN_VALUE_HERE

The resource server can then verify that token (which is a JWT) to decide if the call is authorized.

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

No branches or pull requests

2 participants