okta / okta-auth-js

The official js wrapper around Okta's auth API
Other
454 stars 267 forks source link

Login to application dashboard #1431

Open rinsarmu opened 1 year ago

rinsarmu commented 1 year ago

Describe the bug

here is my question.

  1. when user logged into okta using company domain, he can see assigned application to him(if he is authenticated). the when user click on assigned application, the browser redirect user to provided redirect uri.(in my case http://127.0.0.1:5500/index.html).

[ in any way user cannot access this url http://127.0.0.1:5500/index.html if he is not authenticated first]

  1. after user redirected to http://127.0.0.1:5500/index.html this there is external js which sends http Get (http:127.0.0.1:8000/home) request to server. that routes is protected by okta. (http:127.0.0.1:8000). if user is not authorized it should retrun unauthorized message. if not user can access that route.

can any one help me to check whether user is authenticated in this workflow. how my code check whether user has accesstoken to make request?

Reproduction Steps?

No reproduction steps

SDK Versions

7.0.0

Additional Information?

No response

denysoblohin-okta commented 1 year ago

There is async method oktaAuth.isAuthenticated() in the AuthJs SDK that checks for idToken and accessToken

rinsarmu commented 1 year ago

i got this error. OAuthError: Browser requests to the token endpoint must use Proof Key for Code Exchange. when i put below code in my app.js. please can we huddle on slack? i am bit trouble with this. thank you okta

denysoblohin-okta commented 1 year ago

Please post your config. Did you set pkce: false? See the description of the error you get. Did you create SPA app or Web app in Okta Admin Dashboard?

rinsarmu commented 1 year ago

no, i said pkce:true. I created Web app . can u please join me on slack, i am too trouble with configuration. thank you

denysoblohin-okta commented 1 year ago

Please reach out to support@okta.com for help with configuration.

rinsarmu commented 1 year ago

I have send help request to support@okta.com. until that can u give me 5 minutes join me in google meet? please join me at https://meet.google.com/smr-fhtj-rfb