Java Code Examples for io.swagger.models.auth.OAuth2Definition#setType()
The following examples show how to use
io.swagger.models.auth.OAuth2Definition#setType() .
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: SecurityDefinitionConfigurator.java From carbon-device-mgt with Apache License 2.0 | 5 votes |
@Override public void afterScan(Reader reader, Swagger swagger) { OAuth2Definition tokenScheme = new OAuth2Definition(); tokenScheme.setType("oauth2"); tokenScheme.setFlow("application"); tokenScheme.setTokenUrl("https://" + swagger.getHost() + "/oauth2/token"); tokenScheme.setAuthorizationUrl("https://" + swagger.getHost() + "/oauth2/authorize"); tokenScheme.addScope("write:everything", "Full access"); Map<String, SecuritySchemeDefinition> schemes = new HashMap<>(); schemes.put(TOKEN_AUTH_SCHEME, tokenScheme); swagger.setSecurityDefinitions(schemes); }
Example 2
Source File: SecurityDefinitionConfigurator.java From carbon-device-mgt with Apache License 2.0 | 5 votes |
@Override public void afterScan(Reader reader, Swagger swagger) { OAuth2Definition tokenScheme = new OAuth2Definition(); tokenScheme.setType("oauth2"); tokenScheme.setFlow("application"); tokenScheme.setTokenUrl("https://" + swagger.getHost() + "/oauth2/token"); tokenScheme.setAuthorizationUrl("https://" + swagger.getHost() + "/oauth2/authorize"); tokenScheme.addScope("write:everything", "Full access"); Map<String, SecuritySchemeDefinition> schemes = new HashMap<>(); schemes.put(TOKEN_AUTH_SCHEME, tokenScheme); swagger.setSecurityDefinitions(schemes); }
Example 3
Source File: SecurityDefinitionConfigurator.java From carbon-device-mgt with Apache License 2.0 | 5 votes |
@Override public void afterScan(Reader reader, Swagger swagger) { OAuth2Definition tokenScheme = new OAuth2Definition(); tokenScheme.setType("oauth2"); tokenScheme.setFlow("application"); tokenScheme.setTokenUrl("https://" + swagger.getHost() + "/oauth2/token"); tokenScheme.setAuthorizationUrl("https://" + swagger.getHost() + "/oauth2/authorize"); tokenScheme.addScope("write:everything", "Full access"); Map<String, SecuritySchemeDefinition> schemes = new HashMap<>(); schemes.put(TOKEN_AUTH_SCHEME, tokenScheme); swagger.setSecurityDefinitions(schemes); //TODO: Have to add wso2-scopes to swagger definition from here }
Example 4
Source File: SecurityDefinitionConfigurator.java From carbon-device-mgt with Apache License 2.0 | 5 votes |
@Override public void afterScan(Reader reader, Swagger swagger) { OAuth2Definition tokenScheme = new OAuth2Definition(); tokenScheme.setType("oauth2"); tokenScheme.setFlow("application"); tokenScheme.setTokenUrl("https://" + swagger.getHost() + "/oauth2/token"); tokenScheme.setAuthorizationUrl("https://" + swagger.getHost() + "/oauth2/authorize"); tokenScheme.addScope("write:everything", "Full access"); Map<String, SecuritySchemeDefinition> schemes = new HashMap<>(); schemes.put(TOKEN_AUTH_SCHEME, tokenScheme); swagger.setSecurityDefinitions(schemes); //TODO: Have to add wso2-scopes to swagger definition from here }