In that domain, I have created an app, in that redirect after login to my local domain home page
if it is a failed display error message.
I had Implement using widget its working fine, but I needed there is a simple button name with
“click here for okta login” now suppose m click here then need to open organization https://Demo.okta.com and after sign In need to redirect from home
Hello sir,
I have used the given solution which you have given but in this, it shows default design with given widget but I want to implement on my local site without the template and in this, it redirects to org.okta.com home page https://orgnaizationdomain.okta.com/app/UserHome but I want to redirect to My local domain dashboard Mydomain\dashboard
This is my scenario or I want to implement like this not default
Suppose I have declared one button in my login page as given below image
Now when I click on Okta login Button and it gonna be redirect to https://orgnaizationdomain.okta.com/login/login.htm
and in that, if the user exists then it gonna be redirect to Mydomain/dashboard
if fail then display login failed
and this is my view page code
<input class="button-1 login-button" onclick="myFunction()" value="Okta login" />
<script>
function myFunction() {
alert("in");
var signIn = new OktaSignIn({
baseUrl: 'https://${orgnaizationdomain.okta.com}',
authParams: {
issuer: 'https://${orgnaizationdomain.okta.com}/oauth2/default'
}
});
signIn.showSignInToGetTokens({
clientId: '${client id}',
// must be in the list of redirect URIs enabled for the OIDC app
redirectUri: '${mydomain/dashboard}',
// Return an access token from the authorization server
getAccessToken: true,
// Return an ID token from the authorization server
getIdToken: true,
scope: 'openid profile'
});
}
</script>
But in this nothing happen , where I am wrong can you please address me
Regarding the error, it occurred because the redirect_uri passed as query parameter http://www.google.co.in is different than the one added in the application https://www.google.co.in.
Regarding reaching out, please feel free to open a support ticket with us at developers@okta.com and one of our Developer Support Engineers will assist you.
Using this it will redirect to google.co.in and its working fine,
But I need something like that, when I click Custom log in with Okta login it will redirect to the Login page of Okta and after entering the user name and password it will redirect to the home page of my domain site something like this I needed.
If you change the redirect_uri to point back to your application on callback endpoint and hardcode this URL in a button “Custom log in with Okta login”, does it work?