0

I am getting "Response Identifier not found" error

Following is my code

public Docket api() {
    return new Docket(DocumentationType.SWAGGER_2)
            .select()
            .apis(RequestHandlerSelectors.basePackage("com.example.demo"))
            .paths(PathSelectors.any())
            .build().apiInfo(apiInfo()).securitySchemes(Arrays.asList(securityScheme()))
            .securityContexts(Arrays.asList(securityContext()));

}

@Bean
public SecurityConfiguration security() {
    return new SecurityConfiguration(CLIENT_ID,null,"my","newapp","apiKey",ApiKeyVehicle.HEADER,"api_key","");

}

public SecurityScheme securityScheme() {
    LoginEndpoint loginEndpoint =
            new LoginEndpoint(AuthUrl);
    GrantType grantType = new ImplicitGrant(loginEndpoint, "access_token");

    SecurityScheme oauth = new OAuthBuilder().name("spring_oauth")
            .grantTypes(Arrays.asList(grantType))
            .scopes(Arrays.asList(scopes()))
            .build();
    return oauth;
}

private SecurityContext securityContext() {
    return SecurityContext.builder()
            .securityReferences(
                    Arrays.asList(new SecurityReference("spring_oauth", scopes())))
            .forPaths(PathSelectors.any())
            .build();
}
private AuthorizationScope[] scopes() {
    AuthorizationScope[] scopes = {
            new AuthorizationScope("openid", "for authenticating") };
    return scopes;
}

Since i am new to this. please help. My ultimate goal is to autenticate my swagger with azure AD. Thank you in advance.....

0 Answers0