-
Notifications
You must be signed in to change notification settings - Fork 170
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
195ff36
commit a3dad01
Showing
8 changed files
with
206 additions
and
48 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
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
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
69 changes: 69 additions & 0 deletions
69
src/main/java/net/snowflake/client/core/auth/oauth/TokenResponseDTO.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,69 @@ | ||
package net.snowflake.client.core.auth.oauth; | ||
|
||
|
||
import com.fasterxml.jackson.annotation.JsonCreator; | ||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties; | ||
import com.fasterxml.jackson.annotation.JsonProperty; | ||
|
||
class TokenResponseDTO { | ||
|
||
private final String accessToken; | ||
private final String refreshToken; | ||
private final String tokenType; | ||
private final String scope; | ||
private final String username; | ||
private final boolean idpInitiated; | ||
private final long expiresIn; | ||
private final long refreshTokenExpiresIn; | ||
|
||
@JsonCreator(mode = JsonCreator.Mode.PROPERTIES) | ||
public TokenResponseDTO(@JsonProperty("access_token") String accessToken, | ||
@JsonProperty("refresh_token") String refreshToken, | ||
@JsonProperty("token_type") String tokenType, | ||
@JsonProperty("scope") String scope, | ||
@JsonProperty("username") String username, | ||
@JsonProperty("idp_initiated") boolean idpInitiated, | ||
@JsonProperty("expires_in") long expiresIn, | ||
@JsonProperty("refresh_token_expires_in") long refreshTokenExpiresIn) { | ||
this.accessToken = accessToken; | ||
this.tokenType = tokenType; | ||
this.refreshToken = refreshToken; | ||
this.scope = scope; | ||
this.username = username; | ||
this.idpInitiated = idpInitiated; | ||
this.expiresIn = expiresIn; | ||
this.refreshTokenExpiresIn = refreshTokenExpiresIn; | ||
} | ||
|
||
public String getAccessToken() { | ||
return accessToken; | ||
} | ||
|
||
public String getTokenType() { | ||
return tokenType; | ||
} | ||
|
||
public String getRefreshToken() { | ||
return refreshToken; | ||
} | ||
|
||
public String getScope() { | ||
return scope; | ||
} | ||
|
||
public long getExpiresIn() { | ||
return expiresIn; | ||
} | ||
|
||
public String getUsername() { | ||
return username; | ||
} | ||
|
||
public long getRefreshTokenExpiresIn() { | ||
return refreshTokenExpiresIn; | ||
} | ||
|
||
public boolean isIdpInitiated() { | ||
return idpInitiated; | ||
} | ||
} |
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