
YohnC.10155 (Customer) asked a question.
Hello everybody,
From the developer console, I made a custom sign-in page. I have added a login button from the Mircosoft. It does work, but after login, I am being redirected to https://mydomain.com/app/userhome. Is there a way to change this?
I have follow these guide:
https://www.npmjs.com/package/@okta/okta-signin-widget
https://developer.okta.com/docs/guides/add-an-external-idp/microsoft/create-an-app-at-idp/
Here is my code:
<div id="okta-login-container"></div>
var oktaSignIn = new OktaSignIn({
baseUrl: "my_base_url",
client_id: "private_client_id",
redirect_uri: "private_redirect_url,
authParams: {
issuer: "my_base_url",
response_type: ['id_token'],
response_mode: 'fragment',
display: 'page',
state:'private',
nonce: 'private',
scopes: ['openid','profile', 'email'],
pkce: true,
},
idps: [
{id: 'private_id_with_microsoft', text: 'Login with Microsoft', className: 'btn-microsoft' }
]
});
oktaSignIn.renderEl({ el: '*okta-login-container' },
function success(res) {
if(res.status === 'SUCCESS'){
res.session.setCookieAndRedirect('https://domain.com');
}
},
function error(err) {
// This function is invoked with errors the widget cannot recover from:
// Known errors: CONFIG_ERROR, UNSUPPORTED_BROWSER_ERROR
}
);

Hey Yohn! Thank you for posting!
We have resources available specifically for developers at https://developer.okta.com, including a Developer Forum ( https://devforum.okta.com/) and documentation. If you are unable to find the solutions you're looking for there, we would encourage you to contact our dedicated Developer Support team at developers@okta.com, and they will be able to help you out.