springfox.documentation.swagger.web.SecurityConfiguration Java Examples

The following examples show how to use springfox.documentation.swagger.web.SecurityConfiguration. 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: SwaggerAutoConfiguration.java    From open-cloud with MIT License 5 votes vote down vote up
@Bean
public SecurityConfiguration security() {
    return new SecurityConfiguration(openSwaggerProperties.getClientId(),
            openSwaggerProperties.getClientSecret(),
            "realm", openSwaggerProperties.getClientId(),
            "", ApiKeyVehicle.HEADER, "", ",");
}
 
Example #2
Source File: SwaggerConfig.java    From Software-Architecture-with-Spring-5.0 with MIT License 5 votes vote down vote up
@Bean
SecurityConfiguration security() {
    return new SecurityConfiguration(
            null, null, null, null,
            "PUT_HERE_YOUR_JWT",
            ApiKeyVehicle.HEADER,
            "x-auth-token",
            "," /*scope separator*/);
}
 
Example #3
Source File: AuthSwaggerConfig.java    From pacbot with Apache License 2.0 5 votes vote down vote up
@Bean
   public SecurityConfiguration securityInfo() {
	String hostName;
	if(applicationName.equalsIgnoreCase(AUTH_SERVICE)) {
		String url = System.getenv(DOMAIN_URL);
		hostName = url.split(API)[0];
	} else {
		hostName = configUrl.split(API)[0];
	}
	if (dataSource.equalsIgnoreCase(AZURE_READ)) {
		return new SecurityConfiguration(
				clientId, 
				StringUtils.EMPTY, 
				hostName, 
				clientId, 
				BEARER, 
				ApiKeyVehicle.HEADER, 
				AUTHORIZATION, 
				StringUtils.EMPTY
		);
	} else {
		return new SecurityConfiguration(
				null, 
				null, 
				hostName,
				null,
				null,
				ApiKeyVehicle.HEADER, 
				AUTHORIZATION,
				null
		);
	}
}
 
Example #4
Source File: SwaggerConfig.java    From pacbot with Apache License 2.0 5 votes vote down vote up
@Bean
   public SecurityConfiguration securityInfo() {
	String hostName = configUrl.split("/api")[0];
	if (dataSource.equalsIgnoreCase("azuread")) {
		return new SecurityConfiguration(
				clientId, 
				StringUtils.EMPTY, 
				hostName, 
				clientId, 
				BEARER, 
				ApiKeyVehicle.HEADER, 
				AUTHORIZATION, 
				StringUtils.EMPTY
		);
	} else {
		return new SecurityConfiguration(
				null, 
				null, 
				hostName,
				null,
				null,
				ApiKeyVehicle.HEADER, 
				AUTHORIZATION,
				null
		);
	}
}
 
Example #5
Source File: SwaggerConfiguration.java    From halo with GNU General Public License v3.0 5 votes vote down vote up
@Bean
SecurityConfiguration security() {
    return SecurityConfigurationBuilder.builder()
        .clientId("halo-app-client-id")
        .clientSecret("halo-app-client-secret")
        .realm("halo-app-realm")
        .appName("halo-app")
        .scopeSeparator(",")
        .additionalQueryStringParams(null)
        .useBasicAuthenticationWithAccessCodeGrant(false)
        .build();
}
 
Example #6
Source File: SwaggerAutoConfiguration.java    From mcloud with Apache License 2.0 5 votes vote down vote up
@Bean
SecurityConfiguration security() {
    return new SecurityConfiguration(null, null, null, null,
        "",
        ApiKeyVehicle.HEADER,
        "Authorization",
        null);
}
 
Example #7
Source File: OAuthServerConfiguration.java    From microservices-basics-spring-boot with Apache License 2.0 5 votes vote down vote up
@Bean
SecurityConfiguration security() {
	return new SecurityConfiguration(null, null, null, // realm Needed for authenticate button to work
			null, // appName Needed for authenticate button to work
			"BEARER ", // apiKeyValue
			ApiKeyVehicle.HEADER, AUTHORIZATION_HEADER, // apiKeyName
			null);
}
 
Example #8
Source File: SwaggerConfig.java    From ponto-inteligente-api with MIT License 5 votes vote down vote up
@Bean
public SecurityConfiguration security() {
	String token;
	try {
		UserDetails userDetails = this.userDetailsService.loadUserByUsername("[email protected]");
		token = this.jwtTokenUtil.obterToken(userDetails);
	} catch (Exception e) {
		token = "";
	}

	return new SecurityConfiguration(null, null, null, null, "Bearer " + token, ApiKeyVehicle.HEADER,
			"Authorization", ",");
}
 
Example #9
Source File: SwaggerController.java    From open-cloud with MIT License 5 votes vote down vote up
/**
 * swagger安全配置
 *
 * @param commonProperties
 * @return
 */
@Bean
public SecurityConfiguration security(OpenCommonProperties commonProperties) {
    return new SecurityConfiguration(commonProperties.getClientId(),
            commonProperties.getClientSecret(),
            "realm", commonProperties.getClientId(),
            "", ApiKeyVehicle.HEADER, "", ",");
}
 
Example #10
Source File: SwaggerConfig.java    From spring-security-oauth with MIT License 5 votes vote down vote up
@Bean
public SecurityConfiguration security() {
    return SecurityConfigurationBuilder.builder()
    		.clientId(CLIENT_ID)
    		.clientSecret(CLIENT_SECRET)
    		.useBasicAuthenticationWithAccessCodeGrant(true)
    		.build();
}
 
Example #11
Source File: OnrampSwaggerConfiguration.java    From data-highway with Apache License 2.0 5 votes vote down vote up
@Bean
@Primary
SecurityConfiguration onrampSecurity() {
  return SecurityConfigurationBuilder
      .builder()
      .realm("Data Highway")
      .appName("onramp")
      .scopeSeparator(",")
      .additionalQueryStringParams(null)
      .useBasicAuthenticationWithAccessCodeGrant(false)
      .build();
}
 
Example #12
Source File: SwaggerConfig.java    From XS2A-Sandbox with Apache License 2.0 5 votes vote down vote up
@Bean
public SecurityConfiguration security() {
    return builder()
               .clientId(null)
               .clientSecret(null)
               .realm(null)
               .appName(null)
               .scopeSeparator(",")
               .useBasicAuthenticationWithAccessCodeGrant(false)
               .build();
}
 
Example #13
Source File: TppSwaggerConfig.java    From XS2A-Sandbox with Apache License 2.0 5 votes vote down vote up
@Bean
public SecurityConfiguration security() {
    return builder()
               .clientId(null)
               .clientSecret(null)
               .realm(null)
               .appName(null)
               .scopeSeparator(",")
               .useBasicAuthenticationWithAccessCodeGrant(false)
               .build();
}
 
Example #14
Source File: PaverSwaggerConfiguration.java    From data-highway with Apache License 2.0 5 votes vote down vote up
@Bean
@Lazy
SecurityConfiguration paverSecurity() {
  return SecurityConfigurationBuilder
      .builder()
      .realm("Data Highway")
      .appName("paver")
      .scopeSeparator(",")
      .additionalQueryStringParams(null)
      .useBasicAuthenticationWithAccessCodeGrant(false)
      .build();
}
 
Example #15
Source File: Application.java    From springfox-demos with Apache License 2.0 4 votes vote down vote up
@Bean
public SecurityConfiguration securityInfo() {
  return new SecurityConfiguration("abc", "123", "pets", "petstore", "123", ApiKeyVehicle.HEADER, "", ",");
}
 
Example #16
Source File: SwaggerConfig.java    From springfox-oath2-demo with Apache License 2.0 4 votes vote down vote up
@Bean
public SecurityConfiguration securityInfo() {
    return new SecurityConfiguration(clientId, clientSecret, "realm", clientId, "apiKey", ApiKeyVehicle.HEADER, "api_key", "");
}
 
Example #17
Source File: MainController.java    From steady with Apache License 2.0 4 votes vote down vote up
@Bean
SecurityConfiguration security() {
	return new SecurityConfiguration("abc", "123", "pets", "petstore", Constants.HTTP_TENANT_HEADER, ApiKeyVehicle.HEADER, "", ",");
}
 
Example #18
Source File: SwaggerConfig.java    From spring-boot-react-blog with Apache License 2.0 4 votes vote down vote up
@Bean
public SecurityConfiguration security() {
    return new SecurityConfiguration(null, null, null, null,
            "Bearer " + jwtUtil.createAdminToken(), ApiKeyVehicle.HEADER, "Authorization", "," /* scope separator */);
}
 
Example #19
Source File: SwaggerHandler.java    From black-shop with Apache License 2.0 4 votes vote down vote up
@GetMapping("/swagger-resources/configuration/security")
public Mono<ResponseEntity<SecurityConfiguration>> securityConfiguration() {
	return Mono.just(new ResponseEntity<>(
			Optional.ofNullable(securityConfiguration).orElse(SecurityConfigurationBuilder.builder().build()), HttpStatus.OK));
}
 
Example #20
Source File: SwaggerConfig.java    From singleton with Eclipse Public License 2.0 4 votes vote down vote up
@RequestMapping("/swagger-resources/configuration/security")
@ResponseBody
public ResponseEntity<SecurityConfiguration> securityConfiguration() {
	return apiResourceController.securityConfiguration();
}
 
Example #21
Source File: SwaggerHandler.java    From sophia_scaffolding with Apache License 2.0 4 votes vote down vote up
@GetMapping("/configuration/security")
public Mono<ResponseEntity<SecurityConfiguration>> securityConfiguration() {
    return Mono.just(new ResponseEntity<>(
            Optional.ofNullable(securityConfiguration).orElse(SecurityConfigurationBuilder.builder().build()), HttpStatus.OK));
}
 
Example #22
Source File: SwaggerHandler.java    From sophia_scaffolding with Apache License 2.0 4 votes vote down vote up
@GetMapping("/configuration/security")
public Mono<ResponseEntity<SecurityConfiguration>> securityConfiguration() {
    return Mono.just(new ResponseEntity<>(
            Optional.ofNullable(securityConfiguration).orElse(SecurityConfigurationBuilder.builder().build()), HttpStatus.OK));
}
 
Example #23
Source File: SwaggerHandler.java    From sophia_scaffolding with Apache License 2.0 4 votes vote down vote up
@GetMapping("/configuration/security")
public Mono<ResponseEntity<SecurityConfiguration>> securityConfiguration() {
    return Mono.just(new ResponseEntity<>(
            Optional.ofNullable(securityConfiguration).orElse(SecurityConfigurationBuilder.builder().build()), HttpStatus.OK));
}
 
Example #24
Source File: SwaggerController.java    From open-cloud with MIT License 4 votes vote down vote up
@GetMapping("/configuration/security")
public Mono<ResponseEntity<SecurityConfiguration>> securityConfiguration() {
    return Mono.just(new ResponseEntity<>(
            Optional.ofNullable(securityConfiguration).orElse(null), HttpStatus.OK));
}
 
Example #25
Source File: SwaggerHandler.java    From microservices-platform with Apache License 2.0 4 votes vote down vote up
@GetMapping("/configuration/security" )
public Mono<ResponseEntity<SecurityConfiguration>> securityConfiguration() {
    return Mono.just(new ResponseEntity<>(
            Optional.ofNullable(securityConfiguration).orElse(SecurityConfigurationBuilder.builder().build()), HttpStatus.OK));
}
 
Example #26
Source File: FebsDocGatewayAutoConfigure.java    From FEBS-Cloud with Apache License 2.0 4 votes vote down vote up
@Autowired(required = false)
public void setSecurityConfiguration(SecurityConfiguration securityConfiguration) {
    this.securityConfiguration = securityConfiguration;
}
 
Example #27
Source File: SwaggerHandler.java    From open-capacity-platform with Apache License 2.0 4 votes vote down vote up
@GetMapping("/configuration/security")
public Mono<ResponseEntity<SecurityConfiguration>> securityConfiguration() {
    return Mono.just(new ResponseEntity<>(
            Optional.ofNullable(securityConfiguration).orElse(SecurityConfigurationBuilder.builder().build()), HttpStatus.OK));
}
 
Example #28
Source File: MainController.java    From steady with Apache License 2.0 2 votes vote down vote up
/**
 * <p>securityInfo.</p>
 *
 * @return a {@link springfox.documentation.swagger.web.SecurityConfiguration} object.
 */
@Bean
public SecurityConfiguration securityInfo() {
    return new SecurityConfiguration("abc", "123", "pets", "petstore", Constants.HTTP_TENANT_HEADER, ApiKeyVehicle.HEADER, "", ",");
}