gluu
静的公開メンバ関数 | 全メンバ一覧
org.xdi.oxauth.model.token.TokenParamsValidator クラス
org.xdi.oxauth.model.token.TokenParamsValidator 連携図
Collaboration graph

静的公開メンバ関数

static boolean validateParams (String grantType, String code, String redirectUri, String username, String password, String scope, String assertion, String refreshToken)
 
static boolean validateParams (String clientId, String clientSecret)
 
static boolean validateGrantType (GrantType requestedGrantType, GrantType[] clientGrantTypesArray, Set< GrantType > grantTypesSupported)
 

詳解

Validates the parameters received for the token web service.

著者
Javier Rojas Blum
バージョン
July 19, 2017

関数詳解

◆ validateGrantType()

static boolean org.xdi.oxauth.model.token.TokenParamsValidator.validateGrantType ( GrantType  requestedGrantType,
GrantType []  clientGrantTypesArray,
Set< GrantType grantTypesSupported 
)
inlinestatic
73  {
74  if (clientGrantTypesArray == null) {
75  return false;
76  }
77  List<GrantType> clientGrantTypes = Arrays.asList(clientGrantTypesArray);
78 
79  return clientGrantTypes.contains(requestedGrantType) && grantTypesSupported.contains(requestedGrantType);
80  }

◆ validateParams() [1/2]

static boolean org.xdi.oxauth.model.token.TokenParamsValidator.validateParams ( String  grantType,
String  code,
String  redirectUri,
String  username,
String  password,
String  scope,
String  assertion,
String  refreshToken 
)
inlinestatic

Validates the parameters for a token request.

引数
grantTypeThe grant type. This parameter is mandatory. Value must be set to: authorization_code, password, client_credentials, refresh_token, or a valid URI.
codeThe authorization code.
redirectUri
username
password
scope
assertion
refreshToken
戻り値
Returns true when all the parameters are valid.
42  {
43  boolean result = false;
44  if (grantType == null || grantType.isEmpty()) {
45  return false;
46  }
47 
48  GrantType gt = GrantType.fromString(grantType);
49 
50  switch (gt) {
51  case AUTHORIZATION_CODE:
52  result = code != null && !code.isEmpty() && redirectUri != null && !redirectUri.isEmpty();
53  break;
54  case RESOURCE_OWNER_PASSWORD_CREDENTIALS:
55  result = true;
56  break;
57  case CLIENT_CREDENTIALS:
58  result = true;
59  break;
60  case REFRESH_TOKEN:
61  result = refreshToken != null && !refreshToken.isEmpty();
62  break;
63  }
64 
65  return result;
66  }

◆ validateParams() [2/2]

static boolean org.xdi.oxauth.model.token.TokenParamsValidator.validateParams ( String  clientId,
String  clientSecret 
)
inlinestatic
68  {
69  return clientId != null && !clientId.isEmpty()
70  && clientSecret != null && !clientSecret.isEmpty();
71  }

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