Reputation: 21
I got the token from the active directory by using teams tab silent authantication https://learn.microsoft.com/en-us/microsoftteams/platform/tabs/how-to/authentication/auth-tab-aad
Now how do I get that token signed by keyclock identity provider
Upvotes: 0
Views: 549
Reputation: 3158
For any OAuth provider you can follow the steps mentioned in the Tab Authentication documentation. Instead of redirecting to https://login.microsoftonline.com/
you can redirect to your auth provider to complete the login flow.
Open the auth pop-up window using SDK method.
microsoftTeams.authentication.authenticate({
url: window.location.origin + "/tab-auth/start-page",
width: 600,
height: 535,
successCallback: function (result) {
getUserProfile(result.accessToken);
},
failureCallback: function (reason) {
handleAuthError(reason);
}
});
Redirect user to Authentication provider login page in /tab-auth/start-page
let authorizeEndpoint = "Your OAth provider page link here";
window.location.assign(authorizeEndpoint);
User now would be redirect to complete the login.
Once the Login is complete and you receive the token you need to call microsoftTeams.authentication.notifySuccess()
to complete the login flow (This closes the login pop-up).
Please let us know if you are facing any issues.
Upvotes: 1