Interface OAuthGenerator
-
public interface OAuthGenerator
ForTransferPlugin
s that base their authentication on OAuth, a generator class can be used to create the authentication URL and check the user-provided token. The concrete implementation of this interface should be provided to theTransferSettings
class via theOAuth
annotation.
A generator can be extended withOAuthGenerator.WithInterceptor
,OAuthGenerator.WithExtractor
andOAuthGenerator.WithNoRedirectMode
.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interface
OAuthGenerator.WithExtractor
Use a customOAuthTokenExtractor
instead of the default one which depends on theOAuthMode
in use.static interface
OAuthGenerator.WithInterceptor
Use a customOAuthTokenInterceptor
instead of the default one which depends on theOAuthMode
in use.static interface
OAuthGenerator.WithNoRedirectMode
If an OAuth based plugin also supports copy&pasting a token from a website it should extend this interface.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
checkToken(java.lang.String token, java.lang.String csrfState)
Validate the given token and (optional) csrf parameter.java.net.URI
generateAuthUrl(java.net.URI redirectUri)
Generate a URL which can be accessed by a user to authorize Syncany
-
-
-
Method Detail
-
generateAuthUrl
java.net.URI generateAuthUrl(java.net.URI redirectUri) throws StorageException
Generate a URL which can be accessed by a user to authorize Syncany- Parameters:
redirectUri
- The URL to which the OAuth provider should redirect in any case (either success or failure)- Returns:
- A URL to authorize Syncany using the provided redirectUri
- Throws:
StorageException
-
checkToken
void checkToken(java.lang.String token, java.lang.String csrfState) throws StorageException
Validate the given token and (optional) csrf parameter.- Parameters:
token
- Token provided byOAuthTokenWebListener
.csrfState
- Content of the state parameter (optional).- Throws:
StorageException
-
-