-
Notifications
You must be signed in to change notification settings - Fork 133
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added support for Back Channel Login (#682)
- Loading branch information
Showing
7 changed files
with
268 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
45 changes: 45 additions & 0 deletions
45
src/main/java/com/auth0/json/auth/BackChannelAuthorizeResponse.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
package com.auth0.json.auth; | ||
|
||
import com.fasterxml.jackson.annotation.*; | ||
|
||
@JsonIgnoreProperties(ignoreUnknown = true) | ||
@JsonInclude(JsonInclude.Include.NON_NULL) | ||
public class BackChannelAuthorizeResponse { | ||
@JsonProperty("auth_req_id") | ||
private String authReqId; | ||
@JsonProperty("expires_in") | ||
private Long expiresIn; | ||
@JsonProperty("interval") | ||
private Integer interval; | ||
|
||
@JsonCreator | ||
public BackChannelAuthorizeResponse(@JsonProperty("auth_req_id") String authReqId, @JsonProperty("expires_in") Long expiresIn, @JsonProperty("interval") Integer interval) { | ||
this.authReqId = authReqId; | ||
this.expiresIn = expiresIn; | ||
this.interval = interval; | ||
} | ||
|
||
/** | ||
* Getter for the Auth Request ID. | ||
* @return the Auth Request ID. | ||
*/ | ||
public String getAuthReqId() { | ||
return authReqId; | ||
} | ||
|
||
/** | ||
* Getter for the Expires In value. | ||
* @return the Expires In value. | ||
*/ | ||
public Long getExpiresIn() { | ||
return expiresIn; | ||
} | ||
|
||
/** | ||
* Getter for the Interval value. | ||
* @return the Interval value. | ||
*/ | ||
public Integer getInterval() { | ||
return interval; | ||
} | ||
} |
34 changes: 34 additions & 0 deletions
34
src/main/java/com/auth0/json/auth/BackChannelTokenResponse.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
package com.auth0.json.auth; | ||
|
||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties; | ||
import com.fasterxml.jackson.annotation.JsonInclude; | ||
import com.fasterxml.jackson.annotation.JsonProperty; | ||
|
||
@JsonIgnoreProperties(ignoreUnknown = true) | ||
@JsonInclude(JsonInclude.Include.NON_NULL) | ||
public class BackChannelTokenResponse { | ||
@JsonProperty("access_token") | ||
private String accessToken; | ||
@JsonProperty("id_token") | ||
private String idToken; | ||
@JsonProperty("expires_in") | ||
private long expiresIn; | ||
@JsonProperty("scope") | ||
private String scope; | ||
|
||
public String getAccessToken() { | ||
return accessToken; | ||
} | ||
|
||
public String getIdToken() { | ||
return idToken; | ||
} | ||
|
||
public long getExpiresIn() { | ||
return expiresIn; | ||
} | ||
|
||
public String getScope() { | ||
return scope; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"auth_req_id": "red_id_1", | ||
"expires_in": 300, | ||
"interval": 5 | ||
} |
6 changes: 6 additions & 0 deletions
6
src/test/resources/auth/back_channel_login_status_response.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"access_token": "eyJhbGciOiJkaXIi.....", | ||
"id_token": "eyJhbGciOiJSUzI1NiIs.....", | ||
"expires_in": 86400, | ||
"scope": "openid" | ||
} |