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

getKey access from OktaAuth #111

Open
boubou158 opened this issue Nov 16, 2022 · 3 comments
Open

getKey access from OktaAuth #111

boubou158 opened this issue Nov 16, 2022 · 3 comments
Labels
enhancement New feature or request

Comments

@boubou158
Copy link

Describe the feature request?

Due to how the server infrastructure is done, it is not possible to use jwt-java-verifier library to validate the ID token/ access token on backend side since it is doing a call to okta to fetch the current public key to validate the tokens. I can't target any external API from backend side without months of setup to be done.

I am currently looking for a way to, maybe, fetch the key from front end since it seems to be a public key and send it to the backend to be able to validate the tokens. Would there be any security issue?

If no security issues, how could I simply retrieve the key from the frontend to send to the backend? I explored the different methods accessible through OktaAuth service but the method getKey is not directly accessible from it.

Thanks and best regards

New or Affected Resource(s)

NA

Provide a documentation link

No response

Additional Information?

No response

@boubou158 boubou158 added the enhancement New feature or request label Nov 16, 2022
@shuowu-okta
Copy link

@boubou158 You can access the jwk set for your oidc client via Okta well know endpoint, check the jwks_uri field in the response.

@boubou158
Copy link
Author

boubou158 commented Nov 16, 2022

@shuowu-okta thanks for your reply.
Okta well know endpoint will only return me the url isn't it?
Is there any method which is doing directly the call in okta angular? I can see the method getKey in okta auth js but it does not seem to be exposed through okta angular.
Also, do you know if it would be a bad security practice to fetch the public key from front end, pass it to the backend and validate the tokens from there using this public key?

@jaredperreault-okta
Copy link
Contributor

token validation should not be performed on the frontend (client side) nor should requests public keys. These operations are intended to be server-to-server

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

No branches or pull requests

3 participants