Forum Discussion
vcima
Mar 23, 2020Brass Contributor
How can I auto-logged an user inside a Sharepoint Web Part?
I have a website "Play web". When I want to access into this site I have to login previously with user/pass. An authtentication module, handle this info and starts a communication with an...
- Mar 24, 2020Hi,
You can try using Microsoft Authentication Library (MSAL). Please refer the below link
https://docs.microsoft.com/en-us/azure/active-directory/develop/msal-overview
Hope it helps, please like it or mark it as a solution if it resolves ur clarification or issue
-Sudharsan K...
Sudharsan K
Mar 24, 2020Iron Contributor
Hi,
You can try using Microsoft Authentication Library (MSAL). Please refer the below link
https://docs.microsoft.com/en-us/azure/active-directory/develop/msal-overview
Hope it helps, please like it or mark it as a solution if it resolves ur clarification or issue
-Sudharsan K...
You can try using Microsoft Authentication Library (MSAL). Please refer the below link
https://docs.microsoft.com/en-us/azure/active-directory/develop/msal-overview
Hope it helps, please like it or mark it as a solution if it resolves ur clarification or issue
-Sudharsan K...
- vcimaMar 27, 2020Brass Contributor
Hi!, I have solve the problem with this:
import {UserAgentApplication} from "msal";
const config = {
auth: {
clientId: "client-id",
authority: "https://login.microsoftonline.com/tenant-id"
}
};
const myMSALObj = new UserAgentApplication(config);
let accessTokenRequest = {
scopes: ["user.read"],
loginHint: this.context.pageContext.user.loginName,
extraQueryParameters: {domain_hint: 'organizations'}
}
myMSALObj.acquireTokenSilent(accessTokenRequest).then(function(accessTokenResponse) {
// Acquire token silent success
// call API with token
let accessToken = accessTokenResponse.accessToken;
let scopes = accessTokenResponse.scopes;
}).catch(function (error) {
//Acquire token silent failure, and send an interactive request
console.log(error);
if (error.errorMessage.indexOf("interaction_required") !== -1) {
myMSALObj.acquireTokenRedirect(accessTokenRequest);
}
});- vcimaMar 31, 2020Brass Contributor
Hi @Sudharsan K
I have a problem with this accessToken. When I try to validate, something goes wrong: The Token's Signature resulted invalid when verified using the Algorithm: SHA256withRSADo you know what can I do to validate the Azure AD Token?
Regards