Я использую виджет Okta signin для проверки пользователей для программы, которую я написал, и хотел бы передать некоторые данные профиля Okta в мое приложение через URL-адрес. Когда я смотрю на объект, который создает Okta (res), он, по-видимому, раскрывает несколько атрибутов профиля, таких как firstName, lastName, locale, timeZone и login. Предупреждения javascripts отображаются как неопределенные для всех других атрибутов профиля пользователя. Есть ли способ получить доступ к дополнительным атрибутам профиля из профиля okta в этом скрипте или есть другой способ, которым это можно сделать через сам портал Okta. Я включил скрипт для входа в аккаунте из моего кода ниже:Okta - передача параметров профиля okta URL-адресу из виджета signin
<script type="text/javascript">
var baseUrl = 'https://<my company>.okta.com';
var logo = 'https://ok2static.oktacdn.com/bc/image/fileStoreRecord?id=<myid>;
var oktaSignIn = new OktaSignIn({
baseUrl: baseUrl, logo: logo,
labels: {
'primaryauth.title': 'Login',
'primaryauth.username.tooltip': '(email address)'
}
});
oktaSignIn.renderEl(
{el: '#okta-login-container'},
function (res) {
alert(res.user.profile.login);
alert(res.user.profile.firstName);
alert(res.user.profile.lastName);
alert(res.user.profile.locale);
alert(res.user.profile.timeZone);
alert(res.user.profile.streetAddress);
alert(res.user.profile.countryCode);
alert(res.user.profile.city);
alert(res.user.profile.nickName);
alert(res.user.profile.displayName);
alert(res.user.profile.email);
alert(res.user.profile.secondEmail);
alert(res.user.profile.profileUrl);
alert(res.user.profile.preferredLanguage);
alert(res.user.profile.userType);
alert(res.user.profile.organization);
alert(res.user.profile.title);
alert(res.user.profile.division);
alert(res.user.profile.department);
alert(res.user.profile.costCenter);
alert(res.user.profile.employeeNumber);
alert(res.user.profile.mobilePhone);
alert(res.user.profile.primaryPhone);
alert(res.user.profile.city);
alert(res.user.profile.state);
alert(res.user.profile.zipCode);
if (res.status === 'SUCCESS') { res.session.setCookieAndRedirect('http://www.myprogram.aspx?<this is where I would like to pass in Okta profile parameters like streetAddress or City>); }
}
);
</script>
Есть ли какой-нибудь способ изменить, чтобы изменить это заявление, чтобы перейти к окту порталу и передать параметры оттуда внутри самого окта (создать приложение в окте, что я могут передавать параметры профиля пользователя)?
if (res.status === 'SUCCESS') { res.session.setCookieAndRedirect('https://<mycompany>.okta.com); }
}