'How to login using microsoft account in react-native
I want to log in to my app using a Microsoft account in react native when a "Login with Microsoft" button is clicked.
I had used a component called react-native-msal but I am getting errors (as shown in the below image). Can anyone help me on this code or any other component where I can log in using Microsoft account using react native My code:
const config: MSALConfiguration = {
auth: {
clientId: (i have written my client id here in my code),
authority: 'https://login.microsoftonline.com/common'
},
};
const scopes = ['openid', 'profile','user.Read'];
const pca = new PublicClientApplication(config);
console.log(pca);
try {
await pca.init();
} catch (error) {
console.error('Error initializing the pca, check your config.', error);
}
const params: MSALInteractiveParams = { scopes };
const result: MSALResult = await pca.acquireToken(params);
Error:
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|

