Sample Code:
var providers_1 = require("nativescript-oauth2/providers");
configureOAuthProviderMicrosoft() {
var microsoftProviderOptions = {
openIdSupport: "oid-full",
clientId: "XXXXXXXXXXX",
redirectUri: "msauth.com.XXX.XXX://auth",
scopes: ["openid"],
};
var microsoftProvider = new providers_1.TnsOaProviderMicrosoft(microsoftProviderOptions);
return microsoftProvider;
}
var microsoftProvider = this.configureOAuthProviderMicrosoft();
microsoftProvider.authority = "https://XXX.b2clogin.com/tfp/XXX.onmicrosoft.com/B2C_1_TestAD1";
nativescript_oauth2_1.configureTnsOAuth([microsoftProvider]);
var client = new nativescript_oauth2_1.TnsOAuthClient("microsoft");
client.loginWithCompletion(function (tokenResult, error) {
if (error) {
console.log("back to main page with error: ");
console.log(error);
}
else {
console.log("back to main page with access token: ");
console.log(tokenResult);
}
});
Which platform(s) does your issue occur on?
Sample Code: var providers_1 = require("nativescript-oauth2/providers");
configureOAuthProviderMicrosoft() { var microsoftProviderOptions = { openIdSupport: "oid-full", clientId: "XXXXXXXXXXX", redirectUri: "msauth.com.XXX.XXX://auth", scopes: ["openid"], }; var microsoftProvider = new providers_1.TnsOaProviderMicrosoft(microsoftProviderOptions); return microsoftProvider; }
var microsoftProvider = this.configureOAuthProviderMicrosoft(); microsoftProvider.authority = "https://XXX.b2clogin.com/tfp/XXX.onmicrosoft.com/B2C_1_TestAD1"; nativescript_oauth2_1.configureTnsOAuth([microsoftProvider]); var client = new nativescript_oauth2_1.TnsOAuthClient("microsoft");