krishan kamal
krishan kamal

Reputation: 21

Teams silent authentication with keyclock

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

Answers (1)

Wajeed Shaikh
Wajeed Shaikh

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.

  1. 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);
     }
    

    });

  2. Redirect user to Authentication provider login page in /tab-auth/start-page

     let authorizeEndpoint = "Your OAth provider page link here";
     window.location.assign(authorizeEndpoint);
    
  3. User now would be redirect to complete the login.

  4. 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. enter image description here

Upvotes: 1

Related Questions