I am building an Angular SPA and I need the application to automatically detect whether the user has already logged-in, redirect the user to the established Okta login page if they aren’t already logged in, and then once they have logged in, redirect them back to the SPA.
I have already tried the following tutorials from the Okta website at
Neither of these tutorials really demonstrate the functionality that I need. They are also buggy and don’t really work as written, but that’s a separate issue.
Can anyone point me to a tutorial-like resource that shows how to implement this? Bonus points if it’s written for the current version of whatever library it uses.
The first link you posted will be removed soon, as that guide has been deprecated.
Also, you can try a working angular sample here - https://github.com/okta/samples-js-angular
I have been struggling with this one for a couple of days. Some feedback for you guys, in the hopes that it makes it down to whoever writes these things
None of the little code snippets tell you what file to put the code in. You have to decipher it based on the class, and its not very intuitive. Heaven help you if you are starting from scratch because you have nothing to match it with.
When I implement the tutorial, it doesn’t function as described. The login button that it tells you to build doesn’t appear on my page. Instead, I am just automatically forwarded to the login page when I hit my SPA.
The tutorial is incomplete, because it doesn’t tell you how to make the route to your application work after the login. As written, it just loops infinitely - redirect to my page - redirect to Okta page - repeat forever.
Hi @chrisroberton, not sure if you already had this addressed but our angular samples are a really good resource for these issues you have mentioned. Do take a look and see if it helps: https://github.com/okta/samples-js-angular.