How to get Azure onPremisesSamAccountName in react app for sso - msal

26 Views Asked by At

I am using a react app and trying to implement SSO and trying to get the SAM account name once logged in. I am able to get my email in the instance but not the onPremisesSamAccountName

. My code for scopes

const scopes = {
    scopes: ["openid", "profile", "User.Read", "offline_access"],
}; 

const startAuthentication = async () => {
    const loginResponse = await instance.loginRedirect(scopes).catch(err => {
        console.error(err);
    });
    console.log(loginResponse);
    setToken(loginResponse.accessToken);
    getAccessToken(loginResponse.accessToken);
    getIdToken(loginResponse.idToken);
};

instance.getActiveAccount(); is getting all the details but not the samaccount name

0

There are 0 best solutions below