
VikramM.69791 (Customer) asked a question.
I have a webpage, which is created on HTML/CSS and JavaScript. While Page loads, I place an API call to get User name and User Groups from dev-xxxx.okta.com, if it fails I have coded in JavaScript to Redirect to Okta for login and get back to the webpage post authentication.
The problem is, the redirect do not work. Post login, and authentication, it takes me to https://dev-xxxx.okta.com dashboard.
I am new to Okta development and not sure what is it that I am doing is wrong.
If I was already logged in and have a active session in https://dev-xxxx.okta.com, then the page loads good with user name fetched and displayed properly.
I used the example from https://developer.okta.com/blog/2018/06/08/add-authentication-to-any-web-page-in-10-minutes and used the widget API call to get the user details and user group.
And below is the JavaScript authentication to Okta redirect step I am following.
window.location.assign('https://dev-xxxxxx.okta.com/oauth2/v1/authorize?redirect_uri=http://customdsn.organization.com:433');
Any help here is much appreciated

Hello @VikramM.69791 (Customer) Thank you for reacting out to our Community!
Please see this documentation that provides guidance with redirect model:
https://developer.okta.com/docs/guides/sign-into-web-app-redirect/spring-boot/main/
Additionally if you need further assistance we recommend to leverage the Okta Developer forums for this type of questions and take advantage of their expertise.
https://devforum.okta.com/
Community members help others by clicking Like or Select as Best on responses. Try it today.