gluu
公開メンバ関数 | 限定公開メンバ関数 | 非公開変数類 | 静的非公開変数類 | 全メンバ一覧
org.xdi.oxauth.uma.authorization.UmaPCT クラス
org.xdi.oxauth.uma.authorization.UmaPCT の継承関係図
Inheritance graph
org.xdi.oxauth.uma.authorization.UmaPCT 連携図
Collaboration graph

公開メンバ関数

 UmaPCT ()
 
 UmaPCT (int lifeTime)
 
String getDn ()
 
void setDn (String dn)
 
String getClientId ()
 
void setClientId (String clientId)
 
String getClaimValuesAsJson ()
 
void setClaimValuesAsJson (String claimValuesAsJson)
 
JwtClaims getClaims ()
 
void setClaims (JwtClaims claims) throws InvalidJwtException
 
void checkExpired ()
 
void checkExpired (Date now)
 
boolean isValid ()
 
String getCode ()
 
void setCode (String code)
 
Date getCreationDate ()
 
void setCreationDate (Date creationDate)
 
Date getExpirationDate ()
 
void setExpirationDate (Date expirationDate)
 
boolean isRevoked ()
 
synchronized void setRevoked (boolean revoked)
 
boolean isExpired ()
 
synchronized void setExpired (boolean expired)
 
String getAuthMode ()
 
void setAuthMode (String authMode)
 
String getSessionDn ()
 
void setSessionDn (String sessionDn)
 
int getExpiresIn ()
 
String getHash (SignatureAlgorithm signatureAlgorithm)
 

限定公開メンバ関数

 UmaPCT (String code, Date creationDate, Date expirationDate)
 

非公開変数類

String dn
 
String clientId
 
String claimValuesAsJson
 

静的非公開変数類

static final Logger log = LoggerFactory.getLogger(UmaPCT.class)
 

詳解

著者
yuriyz on 05/30/2017.

構築子と解体子

◆ UmaPCT() [1/3]

org.xdi.oxauth.uma.authorization.UmaPCT.UmaPCT ( )
inline
34  {
35  super(UmaPctService.DEFAULT_PCT_LIFETIME);
36  }

◆ UmaPCT() [2/3]

org.xdi.oxauth.uma.authorization.UmaPCT.UmaPCT ( int  lifeTime)
inline
38  {
39  super(lifeTime);
40  }

◆ UmaPCT() [3/3]

org.xdi.oxauth.uma.authorization.UmaPCT.UmaPCT ( String  code,
Date  creationDate,
Date  expirationDate 
)
inlineprotected
42  {
44  }
Date creationDate
Definition: AbstractToken.java:42
Date expirationDate
Definition: AbstractToken.java:44
String code
Definition: AbstractToken.java:40

関数詳解

◆ checkExpired() [1/2]

void org.xdi.oxauth.model.common.AbstractToken.checkExpired ( )
inlineinherited

Checks whether the token has expired and if true, marks itself as expired.

84  {
85  checkExpired(new Date());
86  }
void checkExpired()
Definition: AbstractToken.java:84

◆ checkExpired() [2/2]

void org.xdi.oxauth.model.common.AbstractToken.checkExpired ( Date  now)
inlineinherited

Checks whether the token has expired and if true, marks itself as expired.

91  {
92  if (now.after(expirationDate)) {
93  expired = true;
94  }
95  }
boolean expired
Definition: AbstractToken.java:46
Date expirationDate
Definition: AbstractToken.java:44

◆ getAuthMode()

String org.xdi.oxauth.model.common.AbstractToken.getAuthMode ( )
inlineinherited

Returns the authentication mode.

戻り値
The authentication mode.
204  {
205  return authMode;
206  }
String authMode
Definition: AbstractToken.java:49

◆ getClaims()

JwtClaims org.xdi.oxauth.uma.authorization.UmaPCT.getClaims ( )
inline
70  {
71  try {
72  return StringUtils.isNotBlank(claimValuesAsJson) ? new JwtClaims(new JSONObject(claimValuesAsJson)) : new JwtClaims();
73  } catch (Exception e) {
74  log.error("Failed to parse PCT claims. " + e.getMessage(), e);
75  return null;
76  }
77  }
String claimValuesAsJson
Definition: UmaPCT.java:32
static final Logger log
Definition: UmaPCT.java:25

◆ getClaimValuesAsJson()

String org.xdi.oxauth.uma.authorization.UmaPCT.getClaimValuesAsJson ( )
inline
62  {
63  return claimValuesAsJson;
64  }
String claimValuesAsJson
Definition: UmaPCT.java:32

◆ getClientId()

String org.xdi.oxauth.uma.authorization.UmaPCT.getClientId ( )
inline
54  {
55  return clientId;
56  }
String clientId
Definition: UmaPCT.java:30

◆ getCode()

String org.xdi.oxauth.model.common.AbstractToken.getCode ( )
inlineinherited

Returns the token code.

戻り値
The Code of the token.
112  {
113  return code;
114  }
String code
Definition: AbstractToken.java:40

◆ getCreationDate()

Date org.xdi.oxauth.model.common.AbstractToken.getCreationDate ( )
inlineinherited

Returns the creation date of the token.

戻り値
The creation date.
130  {
131  return creationDate != null ? new Date(creationDate.getTime()) : null;
132  }
Date creationDate
Definition: AbstractToken.java:42

◆ getDn()

String org.xdi.oxauth.uma.authorization.UmaPCT.getDn ( )
inline
46  {
47  return dn;
48  }
String dn
Definition: UmaPCT.java:28

◆ getExpirationDate()

Date org.xdi.oxauth.model.common.AbstractToken.getExpirationDate ( )
inlineinherited

Returns the expiration date of the token.

戻り値
The expiration date.
148  {
149  return expirationDate != null ? new Date(expirationDate.getTime()) : null;
150  }
Date expirationDate
Definition: AbstractToken.java:44

◆ getExpiresIn()

int org.xdi.oxauth.model.common.AbstractToken.getExpiresIn ( )
inlineinherited

Returns the lifetime in seconds of the token.

戻り値
The lifetime in seconds of the token.
230  {
231  int expiresIn = 0;
232 
233  checkExpired();
234  if (isValid()) {
235  long diff = expirationDate.getTime() - new Date().getTime();
236  expiresIn = diff != 0 ? (int) (diff / 1000) : 0;
237  }
238 
239  return expiresIn;
240  }
Date expirationDate
Definition: AbstractToken.java:44
boolean isValid()
Definition: AbstractToken.java:103
void checkExpired()
Definition: AbstractToken.java:84

◆ getHash()

String org.xdi.oxauth.model.common.AbstractToken.getHash ( SignatureAlgorithm  signatureAlgorithm)
inlineinherited
242  {
243  String hash = null;
244 
245  try {
246  byte[] digest;
247  if (signatureAlgorithm == SignatureAlgorithm.HS256 ||
248  signatureAlgorithm == SignatureAlgorithm.RS256 ||
249  signatureAlgorithm == SignatureAlgorithm.ES256) {
250  digest = JwtUtil.getMessageDigestSHA256(code);
251  } else if (signatureAlgorithm == SignatureAlgorithm.HS384 ||
252  signatureAlgorithm == SignatureAlgorithm.RS384 ||
253  signatureAlgorithm == SignatureAlgorithm.ES512) {
254  digest = JwtUtil.getMessageDigestSHA384(code);
255  } else if (signatureAlgorithm == SignatureAlgorithm.HS512 ||
256  signatureAlgorithm == SignatureAlgorithm.RS384 ||
257  signatureAlgorithm == SignatureAlgorithm.ES512) {
258  digest = JwtUtil.getMessageDigestSHA512(code);
259  } else { // Default
260  digest = JwtUtil.getMessageDigestSHA256(code);
261  }
262 
263  if (digest != null) {
264  byte[] lefMostHalf = new byte[digest.length / 2];
265  System.arraycopy(digest, 0, lefMostHalf, 0, lefMostHalf.length);
266  hash = Base64Util.base64urlencode(lefMostHalf);
267  }
268  } catch (NoSuchAlgorithmException e) {
269  } catch (UnsupportedEncodingException e) {
270  } catch (NoSuchProviderException e) {
271  } catch (Exception e) {
272  }
273 
274  return hash;
275  }
String code
Definition: AbstractToken.java:40

◆ getSessionDn()

String org.xdi.oxauth.model.common.AbstractToken.getSessionDn ( )
inlineinherited
217  {
218  return sessionDn;
219  }
String sessionDn
Definition: AbstractToken.java:51

◆ isExpired()

boolean org.xdi.oxauth.model.common.AbstractToken.isExpired ( )
inlineinherited

Return true if the token has expired.

戻り値
true if the token has expired.
185  {
186  return expired;
187  }
boolean expired
Definition: AbstractToken.java:46

◆ isRevoked()

boolean org.xdi.oxauth.model.common.AbstractToken.isRevoked ( )
inlineinherited

Returns true if the token has been revoked.

戻り値
true if the token has been revoked.
166  {
167  return revoked;
168  }
boolean revoked
Definition: AbstractToken.java:45

◆ isValid()

boolean org.xdi.oxauth.model.common.AbstractToken.isValid ( )
inlineinherited

Checks whether a token is valid, it is valid if it is not revoked and not expired.

戻り値
Returns true if the token is valid.
103  {
104  return !revoked && !expired;
105  }
boolean expired
Definition: AbstractToken.java:46
boolean revoked
Definition: AbstractToken.java:45

◆ setAuthMode()

void org.xdi.oxauth.model.common.AbstractToken.setAuthMode ( String  authMode)
inlineinherited

Sets the authentication mode.

引数
authModeThe authentication mode.
213  {
214  this.authMode = authMode;
215  }
String authMode
Definition: AbstractToken.java:49

◆ setClaims()

void org.xdi.oxauth.uma.authorization.UmaPCT.setClaims ( JwtClaims  claims) throws InvalidJwtException
inline
79  {
80  if (claims != null) {
81  claimValuesAsJson = claims.toJsonString();
82  } else {
83  claimValuesAsJson = null;
84  }
85  }
String claimValuesAsJson
Definition: UmaPCT.java:32

◆ setClaimValuesAsJson()

void org.xdi.oxauth.uma.authorization.UmaPCT.setClaimValuesAsJson ( String  claimValuesAsJson)
inline
66  {
68  }
String claimValuesAsJson
Definition: UmaPCT.java:32

◆ setClientId()

void org.xdi.oxauth.uma.authorization.UmaPCT.setClientId ( String  clientId)
inline
58  {
59  this.clientId = clientId;
60  }
String clientId
Definition: UmaPCT.java:30

◆ setCode()

void org.xdi.oxauth.model.common.AbstractToken.setCode ( String  code)
inlineinherited

Sets the token code.

引数
codeThe code of the token.
121  {
122  this.code = code;
123  }
String code
Definition: AbstractToken.java:40

◆ setCreationDate()

void org.xdi.oxauth.model.common.AbstractToken.setCreationDate ( Date  creationDate)
inlineinherited

Sets the creation date of the token.

引数
creationDateThe creation date.
139  {
140  this.creationDate = creationDate != null ? new Date(creationDate.getTime()) : null;
141  }
Date creationDate
Definition: AbstractToken.java:42

◆ setDn()

void org.xdi.oxauth.uma.authorization.UmaPCT.setDn ( String  dn)
inline
50  {
51  this.dn = dn;
52  }
String dn
Definition: UmaPCT.java:28

◆ setExpirationDate()

void org.xdi.oxauth.model.common.AbstractToken.setExpirationDate ( Date  expirationDate)
inlineinherited

Sets the expiration date of the token.

引数
expirationDateThe expiration date.
157  {
158  this.expirationDate = expirationDate != null ? new Date(expirationDate.getTime()) : null;
159  }
Date expirationDate
Definition: AbstractToken.java:44

◆ setExpired()

synchronized void org.xdi.oxauth.model.common.AbstractToken.setExpired ( boolean  expired)
inlineinherited

Sets the value of the expired flag to indicate whether the token has expired.

引数
expiredExpire or not.
195  {
196  this.expired = expired;
197  }
boolean expired
Definition: AbstractToken.java:46

◆ setRevoked()

synchronized void org.xdi.oxauth.model.common.AbstractToken.setRevoked ( boolean  revoked)
inlineinherited

Sets the value of the revoked flag to indicate whether the token has been revoked.

引数
revokedRevoke or not.
176  {
177  this.revoked = revoked;
178  }
boolean revoked
Definition: AbstractToken.java:45

◆ setSessionDn()

void org.xdi.oxauth.model.common.AbstractToken.setSessionDn ( String  sessionDn)
inlineinherited
221  {
222  this.sessionDn = sessionDn;
223  }
String sessionDn
Definition: AbstractToken.java:51

メンバ詳解

◆ claimValuesAsJson

String org.xdi.oxauth.uma.authorization.UmaPCT.claimValuesAsJson
private

◆ clientId

String org.xdi.oxauth.uma.authorization.UmaPCT.clientId
private

◆ dn

String org.xdi.oxauth.uma.authorization.UmaPCT.dn
private

◆ log

final Logger org.xdi.oxauth.uma.authorization.UmaPCT.log = LoggerFactory.getLogger(UmaPCT.class)
staticprivate

このクラス詳解は次のファイルから抽出されました: