问题
I am building a Vue.js application with Okta authentication, loosely based on the following: https://developer.okta.com/blog/2018/02/15/build-crud-app-vuejs-node and https://developer.okta.com/docs/concepts/okta-hosted-flows/. I am trying to gain a better understanding of how to use a callback route when adding Okta to the Vue router. According to these docs, after authenticating the user in the Okta sign up page, the app is briefly redirected to an unseen component called Auth.handleCallback
, which handles the redirect to the final routing destination (ex. Home.vue), while also persisting the IDToken
in the browser. I understand that this token contains information about the end-user that can be repurposed in other components throughout the app.
What I don't fully understand is Auth.handleCallback
's role in regards to rerouting back to the app's final destination, as well as "persisting" the token. Does this mean that Auth.handleCallback
is responsible for both adding the token to the browser AND persisting the token? When these docs say "persisting the IDToken
", does this mean that it is enabling the token to remain in the browser for later access to the app?
Thanks for the clarification!
来源:https://stackoverflow.com/questions/60582551/how-to-set-up-a-callback-route-in-a-vue-js-okta-app