springfox.documentation.swagger.web.ApiKeyVehicle Java Examples

The following examples show how to use springfox.documentation.swagger.web.ApiKeyVehicle. 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: 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 #2
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 #3
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 #4
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 #5
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 #6
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 #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: 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 #9
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 #10
Source File: SwaggerConfiguration.java    From mica with GNU Lesser General Public License v3.0 4 votes vote down vote up
/**
 * 配置基于 ApiKey 的鉴权对象
 *
 * @return {ApiKey}
 */
private ApiKey apiKey(MicaSwaggerProperties properties) {
	return new ApiKey(properties.getAuthorization().getName(),
		properties.getAuthorization().getKeyName(),
		ApiKeyVehicle.HEADER.getValue());
}
 
Example #11
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 #12
Source File: SwaggerAutoConfiguration.java    From spring-boot-starter-swagger with Apache License 2.0 4 votes vote down vote up
/**
 * 配置基于 ApiKey 的鉴权对象
 *
 * @return
 */
private ApiKey apiKey() {
    return new ApiKey(swaggerProperties().getAuthorization().getName(),
            swaggerProperties().getAuthorization().getKeyName(),
            ApiKeyVehicle.HEADER.getValue());
}
 
Example #13
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 #14
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 #15
Source File: Swagger2AutoConfiguration.java    From cola-cloud with MIT License 4 votes vote down vote up
private ApiKey apiKey() {
    return new ApiKey(swagger2Properties.getApiName(), swagger2Properties.getApiKeyName(), ApiKeyVehicle.HEADER.getValue());
}
 
Example #16
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, "", ",");
}
 
Example #17
Source File: ApiBootSwaggerAutoConfiguration.java    From api-boot with Apache License 2.0 2 votes vote down vote up
/**
 * 配置Swagger整合Oauth2时的请求Key信息
 * 使用头部传递方式 Authorization: Beare TokenValue
 *
 * @return apiKey
 */
private ApiKey apiKey() {
    return new ApiKey(swaggerProperties.getAuthorization().getName(), swaggerProperties.getAuthorization().getKeyName(), ApiKeyVehicle.HEADER.getValue());
}