Package org.codice.ddf.cxf.oauth
Interface OAuthSecurity
- All Known Implementing Classes:
OAuthSecurityImpl
public interface OAuthSecurity
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionvoidsetSystemTokenOnClient(org.apache.cxf.jaxrs.client.Client client, String clientId, String clientSecret, String discoveryUrl) Gets the system's access token from the token storage to set it to the OAUTH header.voidsetUserTokenOnClient(org.apache.cxf.jaxrs.client.Client client, ddf.security.Subject subject, String sourceId) Gets the user's access token from the token storage to set it to the OAUTH header.voidsetUserTokenOnClient(org.apache.cxf.jaxrs.client.Client client, String sourceId, String clientId, String clientSecret, String username, String password, String discoveryUrl, Map<String, String> additionalParameters) Gets the user's access token from the token storage to set it to the OAUTH header.
-
Field Details
-
OAUTH
- See Also:
-
-
Method Details
-
setUserTokenOnClient
void setUserTokenOnClient(org.apache.cxf.jaxrs.client.Client client, ddf.security.Subject subject, String sourceId) Gets the user's access token from the token storage to set it to the OAUTH header. Used when a source is configured to use Authentication Code flow/grant.- Parameters:
client- Non-null client to set the access token on.subject- subject used to get the session IDsourceId- the id of the source using OAuth needed to get the correct tokens
-
setUserTokenOnClient
void setUserTokenOnClient(org.apache.cxf.jaxrs.client.Client client, String sourceId, String clientId, String clientSecret, String username, String password, String discoveryUrl, Map<String, String> additionalParameters) Gets the user's access token from the token storage to set it to the OAUTH header. If one is not available, make a call to the OAuth provider to get tokens. Used when a source is configured to use Resource Owner Password Credentials flow/grant.- Parameters:
client- Non-null client to set the access token on.sourceId- The ID of the source using OAuth needed to get the correct tokensclientId- The client ID registered with the OAuth providerclientSecret- The client secret registered with the OAuth providerusername- The user's usernamepassword- The user's passworddiscoveryUrl- The metadata URL of the OAuth provideradditionalParameters- Additional queryParameters to send to the OAuth provider
-
setSystemTokenOnClient
void setSystemTokenOnClient(org.apache.cxf.jaxrs.client.Client client, String clientId, String clientSecret, String discoveryUrl) Gets the system's access token from the token storage to set it to the OAUTH header. If one can not be found, retrieves the system's access token from the configured OAuth provider. Used when a source is configured to use Client Credentials flow/grant.- Parameters:
client- Non-null client to set the access token on.clientId- The client ID registered with the OAuth providerclientSecret- The client secret registered with the OAuth providerdiscoveryUrl- the metadata URL of the OAuth provider
-