@Test
    void verifyIdToken() throws Throwable {
        val principal = RegisteredServiceTestUtils.getPrincipal(UUID.randomUUID().toString(),
            Map.of(
                "color", List.of("red", "green"),
                "memberOf", List.of("admin"),
                AuthenticationManager.AUTHENTICATION_METHOD_ATTRIBUTE, List.of("mfa-something")
            )
        );
        val authentication = RegisteredServiceTestUtils.getAuthentication(principal,
            Map.of(casProperties.getAuthn().getMfa().getCore().getAuthenticationContextAttribute(), List.of("something")));
        val accessToken = buildAccessToken(authentication);
        ticketRegistry.addTicket(accessToken);

        val registeredService = newOidcRegisteredService(accessToken.getClientId());
        servicesManager.save(registeredService);

        val idTokenContext = IdTokenGenerationContext.builder()
            .accessToken(accessToken)
            .responseType(OAuth20ResponseTypes.CODE)
            .grantType(OAuth20GrantTypes.AUTHORIZATION_CODE)
            .registeredService(registeredService)
            .build();
        val idToken = oidcIdTokenGenerator.generate(idTokenContext);
        assertNotNull(idToken);

        mockMvc.perform(post("/heimdall/authorize")
            .contentType(MediaType.APPLICATION_JSON)
            .content(AuthorizationRequest.builder()
                .uri("/api/claims")
                .method("PUT")
                .namespace("API_CLAIMS")
                .build()
                .toJson()
            )
            .header(HttpHeaders.AUTHORIZATION, "Bearer %s".formatted(idToken.token()))
            .accept(MediaType.APPLICATION_JSON)
        ).andExpect(status().isOk());

    }
This is {@link HeimdallAuthorizationControllerTests}.

@author Misagh Moayyed
@since 7.2.0
support/cas-server-support-heimdall/src/test/java/org/apereo/cas/heimdall/HeimdallAuthorizationControllerTests.java