Class DeveloperAuthenticationCallbackRequest
- java.lang.Object
-
- com.authlete.common.dto.DeveloperAuthenticationCallbackRequest
-
- All Implemented Interfaces:
Serializable
public class DeveloperAuthenticationCallbackRequest extends Object implements Serializable
Developer authentication request from Authlete to a service implementation.When a client application developer needs to be authenticated at the Client Application Developer Console (which Authlete provides for client application developers on behalf of the service), Authlete makes a developer authentication callback request to the developer authentication callback endpoint of the service. This class represents the format of the request.
When the developer tried end-user authentication by inputting his/her credentials to the input fields of the form,
id
andpassword
in this authentication callback request are the values that the developer has input.On the other hand, when the developer tried developer authentication by signing in an SNS such as Facebook,
id
represents the subject (unique identifier) of the developer in the SNS andpassword
has no meaning. In this case,sns
andaccessToken
are notnull
.accessToken
in this request is the value of the access token issued by the SNS which your implementation of the developer authentication callback endpoint may use as necessary.Some notes specific to respective SNSes.
-
The value of
id
is unique to each Facebook application and cannot be used across different applications. If you need the third party ID, make an API call to/me
endpoint withfields=third_party_id
andaccess_token={accessToken}
. See the API document of Facebook for details.The value of
rawTokenResponse
is in the form ofapplication/x-www-form-urlencoded
(notapplication/json
). This is a violation against RFC 6749 (OAuth 2.0).The value of
refreshToken
is empty.The value of expiresIn is the value of
expires
in the response from the token endpoint of Facebook.
- Since:
- 1.9
- Author:
- Takahiko Kawasaki
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description DeveloperAuthenticationCallbackRequest()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
getAccessToken()
Get the access token returned by the SNS which the developer used for social login.long
getExpiresIn()
Get the lifetime of the access token in seconds.String
getId()
Get the ID of the developer to authenticate.String
getPassword()
Get the password of the developer to authenticate.String
getRawTokenResponse()
Get the raw response from the token endpoint of the SNS.String
getRefreshToken()
Get the refresh token returned by the SNS which the developer used for social login.long
getServiceApiKey()
Get the API key of the target service.Sns
getSns()
Get the SNS that the developer used for social login.DeveloperAuthenticationCallbackRequest
setAccessToken(String accessToken)
Set the access token returned by the SNS which the developer used for social login.DeveloperAuthenticationCallbackRequest
setExpiresIn(long expiresIn)
Set the lifetime of the access token in seconds.DeveloperAuthenticationCallbackRequest
setId(String id)
Set the ID of the developer to authenticate.DeveloperAuthenticationCallbackRequest
setPassword(String password)
Set the password of the developer to authenticate.DeveloperAuthenticationCallbackRequest
setRawTokenResponse(String response)
Set the raw response from the token endpoint of the SNS.DeveloperAuthenticationCallbackRequest
setRefreshToken(String refreshToken)
Set the refresh token returned by the SNS which the developer used for social login.DeveloperAuthenticationCallbackRequest
setServiceApiKey(long apiKey)
Set the API key of the target service.DeveloperAuthenticationCallbackRequest
setSns(Sns sns)
Set the SNS that the developer used for social login.
-
-
-
Method Detail
-
getServiceApiKey
public long getServiceApiKey()
Get the API key of the target service.This property is always set when Authlete makes a request.
- Returns:
- The API key of the target service.
-
setServiceApiKey
public DeveloperAuthenticationCallbackRequest setServiceApiKey(long apiKey)
Set the API key of the target service.- Parameters:
apiKey
- The API key of the target service.- Returns:
this
object.
-
getId
public String getId()
Get the ID of the developer to authenticate.When the value of
sns
property isnull
, this property holds the value of the login ID that the developer has entered to the login ID field in the login form of the Client Application Developer Console (which Authlete provides for client application developers on behalf of the service).On the other hand, if
sns
property is notnull
, this property holds the subject (= unique identifier) of the developer in the SNS.This property is always set when Authlete makes a request.
- Returns:
- The ID of the developer to authenticate.
-
setId
public DeveloperAuthenticationCallbackRequest setId(String id)
Set the ID of the developer to authenticate.- Parameters:
id
- The ID of the developer to authenticate.- Returns:
this
object.
-
getPassword
public String getPassword()
Get the password of the developer to authenticate.This property holds the value of the password that the developer has entered to the password field in the login form of the Client Application Developer Console (which Authlete provides for client application developers on behalf of the service).
If
sns
property isnull
, it is ensured that this property is notnull
. In such a case, authentication should be performed on the pair ofid
property and thispassword
property. On the other hand, ifsns
property is notnull
, this property has no meaning, because authentication has been performed by the SNS.- Returns:
- The password of the developer to authenticate.
-
setPassword
public DeveloperAuthenticationCallbackRequest setPassword(String password)
Set the password of the developer to authenticate.- Parameters:
password
- The password of the developer to authenticate.- Returns:
this
object.
-
getSns
public Sns getSns()
Get the SNS that the developer used for social login.- Returns:
- The SNS that the developer used for social login.
null
is returned if the developer did not use social login.
-
setSns
public DeveloperAuthenticationCallbackRequest setSns(Sns sns)
Set the SNS that the developer used for social login.- Parameters:
sns
- The SNS that the developer used for social login.- Returns:
this
object.
-
getAccessToken
public String getAccessToken()
Get the access token returned by the SNS which the developer used for social login.- Returns:
- The access token returned by the SNS.
null
is returned when social login was not used.
-
setAccessToken
public DeveloperAuthenticationCallbackRequest setAccessToken(String accessToken)
Set the access token returned by the SNS which the developer used for social login.- Parameters:
accessToken
- The access token returned by the SNS.- Returns:
this
object.
-
getRefreshToken
public String getRefreshToken()
Get the refresh token returned by the SNS which the developer used for social login.- Returns:
- The refresh token returned by the SNS.
null
is returned when social login was not used or if the SNS did not return a refresh token.
-
setRefreshToken
public DeveloperAuthenticationCallbackRequest setRefreshToken(String refreshToken)
Set the refresh token returned by the SNS which the developer used for social login.- Parameters:
refreshToken
- The refresh token returned by the SNS.- Returns:
this
object.
-
getExpiresIn
public long getExpiresIn()
Get the lifetime of the access token in seconds.- Returns:
- The lifetime of the access token in seconds. 0 is returned when social login was not used of if the SNS did not return information about lifetime of the access token.
-
setExpiresIn
public DeveloperAuthenticationCallbackRequest setExpiresIn(long expiresIn)
Set the lifetime of the access token in seconds.- Parameters:
expiresIn
- The lifetime of the access token in seconds.- Returns:
this
object.
-
getRawTokenResponse
public String getRawTokenResponse()
Get the raw response from the token endpoint of the SNS.If the SNS complies with RFC 6749, the format is JSON. Note that Facebook returns application/x-www-form-urlencoded.
- Returns:
- The raw response from the token endpoint of the SNS.
-
setRawTokenResponse
public DeveloperAuthenticationCallbackRequest setRawTokenResponse(String response)
Set the raw response from the token endpoint of the SNS.- Parameters:
response
- The raw response from the token endpoint of the SNS.- Returns:
this
object.
-
-