public class DeveloperAuthenticationCallbackRequest extends Object implements Serializable
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 an 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 and password 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 and password
has no meaning. In this case, sns and accessToken are
not null. 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
idis unique to each Facebook application and cannot be used across different applications. If you need the third party ID, make an API call to/meendpoint withfields=third_party_idandaccess_token={accessToken}. See the API document of Facebook for details.The value of
rawTokenResponseis in the form ofapplication/x-www-form-urlencoded(notapplication/json). This is a violation against RFC 6749 (OAuth 2.0).The value of
refreshTokenis empty.The value of expiresIn is the value of
expiresin the response from the token endpoint of Facebook.
| Constructor and Description |
|---|
DeveloperAuthenticationCallbackRequest() |
| Modifier and Type | Method and 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.
|
public DeveloperAuthenticationCallbackRequest()
public long getServiceApiKey()
This property is always set when Authlete makes a request.
public DeveloperAuthenticationCallbackRequest setServiceApiKey(long apiKey)
apiKey - The API key of the target service.this object.public String getId()
When the value of sns property is null, 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 not null,
this property holds the subject (= unique identifier) of the
developer in the SNS.
This property is always set when Authlete makes a request.
public DeveloperAuthenticationCallbackRequest setId(String id)
id - The ID of the developer to authenticate.this object.public String getPassword()
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 is null, it is ensured that this
property is not null. In such a case, authentication
should be performed on the pair of id property and this
password property. On the other hand, if sns
property is not null, this property has no meaning,
because authentication has been performed by the SNS.
public DeveloperAuthenticationCallbackRequest setPassword(String password)
password - The password of the developer to authenticate.this object.public Sns getSns()
null is returned if the developer did not
use social login.public DeveloperAuthenticationCallbackRequest setSns(Sns sns)
sns - The SNS that the developer used for social login.this object.public String getAccessToken()
null
is returned when social login was not used.public DeveloperAuthenticationCallbackRequest setAccessToken(String accessToken)
accessToken - The access token returned by the SNS.this object.public String getRefreshToken()
null
is returned when social login was not used or if
the SNS did not return a refresh token.public DeveloperAuthenticationCallbackRequest setRefreshToken(String refreshToken)
refreshToken - The refresh token returned by the SNS.this object.public long getExpiresIn()
public DeveloperAuthenticationCallbackRequest setExpiresIn(long expiresIn)
expiresIn - The lifetime of the access token in seconds.this object.public String getRawTokenResponse()
If the SNS complies with RFC 6749, the format is JSON. Note that Facebook returns application/x-www-form-urlencoded.
public DeveloperAuthenticationCallbackRequest setRawTokenResponse(String response)
response - The raw response from the token endpoint of the SNS.this object.Copyright © 2017. All rights reserved.