springfox.documentation.builders.OAuthBuilder Java Examples

The following examples show how to use springfox.documentation.builders.OAuthBuilder. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: SwaggerConfig.java    From springfox-oath2-demo with Apache License 2.0 5 votes vote down vote up
@Bean
SecurityScheme oauth() {
    return new OAuthBuilder()
            .name("OAuth2")
            .scopes(scopes())
            .grantTypes(grantTypes())
            .build();
}
 
Example #2
Source File: SwaggerConfig.java    From spring-security-oauth with MIT License 5 votes vote down vote up
private SecurityScheme securityScheme() {
    GrantType grantType = new AuthorizationCodeGrantBuilder()
    		.tokenEndpoint(new TokenEndpoint(AUTH_SERVER + "/token", "oauthtoken"))
    		.tokenRequestEndpoint(
    		  new TokenRequestEndpoint(AUTH_SERVER + "/authorize", CLIENT_ID, CLIENT_ID))
    		.build();

    SecurityScheme oauth = new OAuthBuilder().name("spring_oauth")
    		.grantTypes(Arrays.asList(grantType))
    		.scopes(Arrays.asList(scopes()))
    		.build();
    return oauth;
}
 
Example #3
Source File: Application.java    From springfox-demos with Apache License 2.0 5 votes vote down vote up
@Bean
SecurityScheme oauth() {
  return new OAuthBuilder()
      .name("petstore_auth")
      .grantTypes(grantTypes())
      .scopes(scopes())
      .build();
}
 
Example #4
Source File: SwaggerConfig.java    From pacbot with Apache License 2.0 4 votes vote down vote up
@Bean
SecurityScheme oauth() {
	return new OAuthBuilder().name(state).grantTypes(grantTypes()).scopes(scopes()).build();
}