jumbojett / OpenID-Connect-PHP

Minimalist OpenID Connect client

Home Page:https://github.com/jumbojett/OpenID-Connect-PHP

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Silent Token Request

SebastianA opened this issue · comments

Hi,
I am using this library with Azure AD and have two app registrations: one is a application that needs to call an API in another app. I need to use Bearer Authentication and obtain an access token with a specific scope in order to call the API. In my SPA, which is built with Angular and uses MSAL, I am trying to acquire a silent access token with the required scope using the acquireTokenSilent method.

In a SPA in Angular with MSAL it looks like that and worked fine:

this.authService.acquireTokenSilent({
        scopes: ['api://00000client_id00000/access_as_user'] // this is the required scope for api app
      }).subscribe(result => {
        // --> result.accessToken;
      });

Is there a way I could solve this problem using the Jumbojett library?

Thanks
Sebastian