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

静的公開メンバ関数

static boolean validateParams (String responseType, String clientId, List< Prompt > prompts, String nonce, String request, String requestUri)
 
static boolean noNonePrompt (List< Prompt > prompts)
 
static boolean validateResponseTypes (List< ResponseType > responseTypes, Client client)
 
static boolean validateGrantType (List< ResponseType > responseTypes, GrantType[] clientGrantTypesArray, Set< GrantType > grantTypesSupported)
 

詳解

Validates the parameters received for the authorize web service.

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

関数詳解

◆ noNonePrompt()

static boolean org.xdi.oxauth.model.authorize.AuthorizeParamsValidator.noNonePrompt ( List< Prompt prompts)
inlinestatic
56  {
57  return !(prompts.contains(Prompt.NONE) && prompts.size() > 1);
58  }

◆ validateGrantType()

static boolean org.xdi.oxauth.model.authorize.AuthorizeParamsValidator.validateGrantType ( List< ResponseType responseTypes,
GrantType []  clientGrantTypesArray,
Set< GrantType grantTypesSupported 
)
inlinestatic
70  {
71  List<GrantType> clientGrantTypes = null;
72  if (clientGrantTypesArray != null) {
73  clientGrantTypes = Arrays.asList(clientGrantTypesArray);
74  }
75  if (responseTypes == null || clientGrantTypes == null || grantTypesSupported == null) {
76  return false;
77  }
78  if (responseTypes.contains(ResponseType.CODE)) {
79  GrantType requestedGrantType = GrantType.AUTHORIZATION_CODE;
80  if (!clientGrantTypes.contains(requestedGrantType) || !grantTypesSupported.contains(requestedGrantType)) {
81  return false;
82  }
83  }
84  if (responseTypes.contains(ResponseType.TOKEN) || responseTypes.contains(ResponseType.ID_TOKEN)) {
85  GrantType requestedGrantType = GrantType.IMPLICIT;
86  if (!clientGrantTypes.contains(requestedGrantType) || !grantTypesSupported.contains(requestedGrantType)) {
87  return false;
88  }
89  }
90 
91  return true;
92  }

◆ validateParams()

static boolean org.xdi.oxauth.model.authorize.AuthorizeParamsValidator.validateParams ( String  responseType,
String  clientId,
List< Prompt prompts,
String  nonce,
String  request,
String  requestUri 
)
inlinestatic

Validates the parameters for an authorization request.

引数
responseTypeThe response type string. This parameter is mandatory, its value must be set to code or token.
clientIdThe client identifier. This parameter is mandatory.
戻り値
Returns true when all the parameters are valid.
38  {
39  List<ResponseType> responseTypes = ResponseType.fromString(responseType, " ");
40  if (responseTypes.contains(ResponseType.TOKEN) || responseTypes.contains(ResponseType.ID_TOKEN)) {
41  if (StringUtils.isBlank(nonce)) {
42  return false;
43  }
44  }
45 
46  if (StringUtils.isNotBlank(request) && StringUtils.isNotBlank(requestUri)) {
47  return false;
48  }
49 
50  boolean validParams = responseType != null && !responseType.isEmpty()
51  && clientId != null && !clientId.isEmpty();
52 
53  return validParams && noNonePrompt(prompts);
54  }
static boolean noNonePrompt(List< Prompt > prompts)
Definition: AuthorizeParamsValidator.java:56

◆ validateResponseTypes()

static boolean org.xdi.oxauth.model.authorize.AuthorizeParamsValidator.validateResponseTypes ( List< ResponseType responseTypes,
Client  client 
)
inlinestatic
60  {
61  if (responseTypes == null || responseTypes.isEmpty() || client == null || client.getResponseTypes() == null) {
62  return false;
63  }
64 
65  List<ResponseType> clientSupportedResponseTypes = Arrays.asList(client.getResponseTypes());
66 
67  return clientSupportedResponseTypes.containsAll(responseTypes);
68  }

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