Angular - Spring API - Azure Entra ID invalid Signature

Discussão em 'Angular' iniciado por pred, Janeiro 15, 2025.

  1. pred

    pred Guest

    I'm getting trouble to setup Microsoft Entra ID configuration. I have an Angular application which is configured like this documentation: https://learn.microsoft.com/en-us/e...tutorial-single-page-apps-angular-prepare-app

    I'm able to connect to my application with the microsoft login. However I need to call spring boot rest APIs with a valid jwt token.

    So I added my http://localhost:8080 to my protected resources map of the interceptor with the scope "user.read" as follow:

    public static MSALInterceptorConfigFactory(): MsalInterceptorConfiguration {
    const protectedResourceMap = new Map<string, Array<string | ProtectedResourceScopes> | null>();
    protectedResourceMap.set('http://localhost:8080', ['user.read']);
    return {
    interactionType: InteractionType.Redirect,
    protectedResourceMap,
    };
    }


    When calling the API the JWT is now well. But the Spring Boot application throw the following error: Caused by: com.nimbusds.jose.proc.BadJWSException: Signed JWT rejected: Invalid signature

    And when I decode my JWT on https://jwt.io/ it also says the the signature is invalid.

    What am I missing ?

    Continue reading...

Compartilhe esta Página