ranveeraggarwal/angular-adal-quickstart

How to get Token as a string?

Closed this issue · 4 comments

How can I fetch the Token as a string as I need to pass the Bearer token to authenticate & call a REST service.

Same problem! Help Please!!

I generally have a service that looks like:

@Injectable()
export class AuthService {

    constructor(private adalService: AdalService) {}

    public getToken(): Observable<string> {
        return this.adalService.acquireToken("https://xyz.onmicrosoft.com/abc").map(
            token => token.toString()
        );
    }
}

@ranveeraggarwal

This is working only for Azure B2B AD and not for Azure B2C AD. I need to provide the B2C SignIn policy. (1) How can I make it work with B2C Azure AD?
(2) How do I list the B2C Azure AD claims?

I am not sure how to do that. But according to this link, you might need to make graph calls to get claims: https://docs.microsoft.com/en-us/azure/active-directory-b2c/active-directory-b2c-devquickstarts-graph-dotnet