Interface OAuthServerDescription
-
public interface OAuthServerDescription
The description of an OAuth authentication server- Since:
- 4.0
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
CLIENT_ID
Key of the client-id propertystatic java.lang.String
CLIENT_SECRET
Key of the client-secret property
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description java.lang.String
getAuthenticationURL(com.inet.authentication.AuthenticationDescription config)
The URL of the authentication redirect without parameters.default java.lang.String
getAuthenticationURL(com.inet.authentication.AuthenticationDescription config, java.lang.String redirectURL, java.lang.String state)
Add the needed parameters to the authentication redirect URL.default java.lang.String
getColor(java.util.Map<java.lang.String,java.lang.String> settings)
Get the color as hex value, e.g.default java.net.URLConnection
getDataConnection(com.inet.authentication.AuthenticationDescription config, java.lang.String accessToken)
Get the URLConnection for user information.default java.lang.String
getIconURL(java.util.Map<java.lang.String,java.lang.String> settings)
Get the Icon resource URL.default java.lang.String
getLoginDisplayName(java.lang.String email, java.lang.String givenName, java.lang.String familyName)
Get the display name of the login in the user manager.default java.lang.String
getScope(com.inet.authentication.AuthenticationDescription config)
Get the scope value.default java.lang.String
getTokenData(com.inet.authentication.AuthenticationDescription config, java.lang.String redirectURL, java.lang.String code)
The POST data to verify the login from the serverjava.lang.String
getTokenURL(com.inet.authentication.AuthenticationDescription config)
The POST URL to verify the login from the server.default boolean
isTrustAllCerificates(com.inet.authentication.AuthenticationDescription config)
Use the authentication server a private certificate and we should trust all certificates.java.lang.String
name()
Get the loginSource/name for this server.
-
-
-
Field Detail
-
CLIENT_ID
static final java.lang.String CLIENT_ID
Key of the client-id property- See Also:
- Constant Field Values
-
CLIENT_SECRET
static final java.lang.String CLIENT_SECRET
Key of the client-secret property- See Also:
- Constant Field Values
-
-
Method Detail
-
name
@Nonnull java.lang.String name()
Get the loginSource/name for this server.- Returns:
- the login source
- Since:
- 4.0
-
getColor
@Nullable default java.lang.String getColor(@Nullable java.util.Map<java.lang.String,java.lang.String> settings)
Get the color as hex value, e.g. "#ff00ee". If null the default color is used.- Parameters:
settings
- the settings in the configuration manager- Returns:
- the color
- Since:
- 21.4
-
getIconURL
@Nullable default java.lang.String getIconURL(@Nullable java.util.Map<java.lang.String,java.lang.String> settings)
Get the Icon resource URL. If null the default Icon is used.- Parameters:
settings
- the settings in the configuration manager- Returns:
- the url
- Since:
- 21.4
-
getScope
@Nonnull default java.lang.String getScope(@Nonnull com.inet.authentication.AuthenticationDescription config)
Get the scope value. The scope are the data which we want grand access.- Parameters:
config
- the current oauth configuration- Returns:
- the scope parameter
- Since:
- 4.0
-
getAuthenticationURL
@Nonnull java.lang.String getAuthenticationURL(@Nonnull com.inet.authentication.AuthenticationDescription config)
The URL of the authentication redirect without parameters. This is the first URL to which the browser will be redirect.- Parameters:
config
- the current configuration- Returns:
- the URL
- Since:
- 4.0
-
getAuthenticationURL
@Nonnull default java.lang.String getAuthenticationURL(@Nonnull com.inet.authentication.AuthenticationDescription config, java.lang.String redirectURL, java.lang.String state)
Add the needed parameters to the authentication redirect URL.- Parameters:
config
- the current oauth configurationredirectURL
- the return URL of this serverstate
- a random state which need to verify later- Returns:
- the URL
- Since:
- 4.0
-
getTokenURL
java.lang.String getTokenURL(@Nonnull com.inet.authentication.AuthenticationDescription config)
The POST URL to verify the login from the server.- Parameters:
config
- the current oauth configuration- Returns:
- the URL
- Since:
- 4.0
-
getTokenData
@Nonnull default java.lang.String getTokenData(@Nonnull com.inet.authentication.AuthenticationDescription config, java.lang.String redirectURL, java.lang.String code)
The POST data to verify the login from the server- Parameters:
config
- the current OAuth configurationredirectURL
- the used callback URL. Must be the same from the authentication requestcode
- the code from the authentication server- Returns:
- the POST data
- Since:
- 4.0
-
getDataConnection
default java.net.URLConnection getDataConnection(@Nonnull com.inet.authentication.AuthenticationDescription config, java.lang.String accessToken) throws java.io.IOException
Get the URLConnection for user information. This connection is only if the provider does not support OpenID or for use of access tokens in web API requests.- Parameters:
config
- the current OAuth configurationaccessToken
- the valid accessToken from a previous authentication- Returns:
- The URL to request the data.
- Throws:
java.io.IOException
- if any I/O error occur- Since:
- 20.4
-
isTrustAllCerificates
default boolean isTrustAllCerificates(@Nonnull com.inet.authentication.AuthenticationDescription config)
Use the authentication server a private certificate and we should trust all certificates. Default is false.- Parameters:
config
- the current OAuth configuration- Returns:
- true for private certificates
- Since:
- 4.0
-
getLoginDisplayName
@Nullable default java.lang.String getLoginDisplayName(@Nullable java.lang.String email, @Nullable java.lang.String givenName, @Nullable java.lang.String familyName)
Get the display name of the login in the user manager. If null then the login id will be show.- Parameters:
email
- possible emailgivenName
- possible given namefamilyName
- possible family name- Returns:
- alternative display name
- Since:
- 4.0
-
-