Class TwitchIdentityProvider
java.lang.Object
com.github.philippheuer.credentialmanager.domain.IdentityProvider
com.github.philippheuer.credentialmanager.identityprovider.OAuth2IdentityProvider
com.github.twitch4j.auth.providers.TwitchIdentityProvider
public class TwitchIdentityProvider
extends com.github.philippheuer.credentialmanager.identityprovider.OAuth2IdentityProvider
Twitch Identity Provider
-
Field Summary
FieldsFields inherited from class com.github.philippheuer.credentialmanager.identityprovider.OAuth2IdentityProvider
authUrl, clientId, clientSecret, deviceUrl, httpClient, OBJECTMAPPER, redirectUrl, responseType, scopeSeperator, tokenEndpointPostType, tokenUrlFields inherited from class com.github.philippheuer.credentialmanager.domain.IdentityProvider
configuration, credentialManager, providerName, providerType -
Constructor Summary
ConstructorsConstructorDescriptionTwitchIdentityProvider(String clientId, String clientSecret, String redirectUrl) ConstructorTwitchIdentityProvider(String clientId, String clientSecret, String redirectUrl, String baseUrl) -
Method Summary
Modifier and TypeMethodDescriptionOptional<com.github.philippheuer.credentialmanager.domain.OAuth2Credential>getAdditionalCredentialInformation(com.github.philippheuer.credentialmanager.domain.OAuth2Credential credential) Get Auth Token InformationisCredentialValid(com.github.philippheuer.credentialmanager.domain.OAuth2Credential credential) Checks whether anOAuth2Credentialis valid.booleanrevokeCredential(com.github.philippheuer.credentialmanager.domain.OAuth2Credential credential) Revokes an access token.Methods inherited from class com.github.philippheuer.credentialmanager.identityprovider.OAuth2IdentityProvider
createDeviceFlowRequest, enableLoggingInterceptor, getAppAccessToken, getAppAccessToken, getAuthenticationUrl, getAuthenticationUrl, getCredentialByCode, getCredentialByUsernameAndPassword, getDeviceAccessToken, getScopedCredentialByUsernameAndPassword, isValid, refreshCredential, renewMethods inherited from class com.github.philippheuer.credentialmanager.domain.IdentityProvider
canEqual, equals, getConfiguration, getCredentialManager, getProviderName, getProviderType, hashCode, setConfiguration, setCredentialManager, setProviderName, setProviderType, toString
-
Field Details
-
PROVIDER_NAME
- See Also:
-
IdentityProvider.getProviderName()- Constant Field Values
-
OFFICIAL_BASE_URL
- See Also:
-
CLI_MOCK_BASE_URL
- See Also:
-
-
Constructor Details
-
TwitchIdentityProvider
Constructor- Parameters:
clientId- OAuth Client IdclientSecret- OAuth Client SecretredirectUrl- Redirect Url
-
TwitchIdentityProvider
-
-
Method Details
-
isCredentialValid
public Optional<Boolean> isCredentialValid(com.github.philippheuer.credentialmanager.domain.OAuth2Credential credential) Checks whether anOAuth2Credentialis valid.Expired tokens will yield false (assuming the network request succeeds).
- Parameters:
credential- the OAuth credential to check- Returns:
- whether the token is valid, or empty if the network request did not succeed
-
getAdditionalCredentialInformation
public Optional<com.github.philippheuer.credentialmanager.domain.OAuth2Credential> getAdditionalCredentialInformation(com.github.philippheuer.credentialmanager.domain.OAuth2Credential credential) Get Auth Token Information- Specified by:
getAdditionalCredentialInformationin classcom.github.philippheuer.credentialmanager.identityprovider.OAuth2IdentityProvider- Parameters:
credential- OAuth2 Credential
-
revokeCredential
public boolean revokeCredential(com.github.philippheuer.credentialmanager.domain.OAuth2Credential credential) Revokes an access token.The clientId passed to
TwitchIdentityProvidermust match that used to create the credential- Parameters:
credential- theOAuth2Credentialto be revoked- Returns:
- whether the credential was successfully revoked
-