gluu
公開メンバ関数 | 静的公開変数類 | 非公開メンバ関数 | 非公開変数類 | 全メンバ一覧
org.xdi.oxauth.service.RequestParameterService クラス
org.xdi.oxauth.service.RequestParameterService 連携図
Collaboration graph

公開メンバ関数

Map< String, String > getAllowedParameters (@Nonnull final Map< String, String > requestParameterMap)
 
Map< String, String > getCustomParameters (@Nonnull final Map< String, String > requestParameterMap)
 
String parametersAsString (final Map< String, String > parameterMap) throws UnsupportedEncodingException
 
Map< String, String > getParametersMap (List< String > extraParameters, final Map< String, String > parameterMap)
 
String getParameterValue (String p_name)
 
Pair< String, String > getParameterValueWithType (String p_name)
 
Object getTypedValue (String stringValue, String type)
 

静的公開変数類

static final List< String > ALLOWED_PARAMETER
 

非公開メンバ関数

void putInMap (Map< String, String > map, String p_name)
 

非公開変数類

Logger log
 
Identity identity
 
AppConfiguration appConfiguration
 

詳解

著者
Yuriy Movchan
Javier Rojas Blum
バージョン
November 24, 2017

関数詳解

◆ getAllowedParameters()

Map<String, String> org.xdi.oxauth.service.RequestParameterService.getAllowedParameters ( @Nonnull final Map< String, String >  requestParameterMap)
inline
81  {
82  Set<String> authorizationRequestCustomAllowedParameters = appConfiguration.getAuthorizationRequestCustomAllowedParameters();
83  if (authorizationRequestCustomAllowedParameters == null) {
84  authorizationRequestCustomAllowedParameters = new HashSet<String>(0);
85  }
86 
87  final Map<String, String> result = new HashMap<String, String>();
88  if (!requestParameterMap.isEmpty()) {
89  final Set<Map.Entry<String, String>> set = requestParameterMap.entrySet();
90  for (Map.Entry<String, String> entry : set) {
91  if (ALLOWED_PARAMETER.contains(entry.getKey()) || authorizationRequestCustomAllowedParameters.contains(entry.getKey())) {
92  result.put(entry.getKey(), entry.getValue());
93  }
94  }
95  }
96 
97  return result;
98  }
AppConfiguration appConfiguration
Definition: RequestParameterService.java:78
Set< String > getAuthorizationRequestCustomAllowedParameters()
Definition: AppConfiguration.java:1377
static final List< String > ALLOWED_PARAMETER
Definition: RequestParameterService.java:47

◆ getCustomParameters()

Map<String, String> org.xdi.oxauth.service.RequestParameterService.getCustomParameters ( @Nonnull final Map< String, String >  requestParameterMap)
inline
100  {
101  Set<String> authorizationRequestCustomAllowedParameters = appConfiguration.getAuthorizationRequestCustomAllowedParameters();
102 
103  final Map<String, String> result = new HashMap<String, String>();
104  if (authorizationRequestCustomAllowedParameters == null) {
105  return result;
106  }
107 
108  if (!requestParameterMap.isEmpty()) {
109  final Set<Map.Entry<String, String>> set = requestParameterMap.entrySet();
110  for (Map.Entry<String, String> entry : set) {
111  if (authorizationRequestCustomAllowedParameters.contains(entry.getKey())) {
112  result.put(entry.getKey(), entry.getValue());
113  }
114  }
115  }
116 
117  return result;
118  }
AppConfiguration appConfiguration
Definition: RequestParameterService.java:78
Set< String > getAuthorizationRequestCustomAllowedParameters()
Definition: AppConfiguration.java:1377

◆ getParametersMap()

Map<String, String> org.xdi.oxauth.service.RequestParameterService.getParametersMap ( List< String >  extraParameters,
final Map< String, String >  parameterMap 
)
inline
137  {
138  final List<String> allowedParameters = new ArrayList<String>(ALLOWED_PARAMETER);
139 
140  if (extraParameters != null) {
141  for (String extraParameter : extraParameters) {
142  putInMap(parameterMap, extraParameter);
143  }
144 
145  allowedParameters.addAll(extraParameters);
146  }
147 
148  for (Iterator<Entry<String, String>> it = parameterMap.entrySet().iterator(); it.hasNext(); ) {
149  Entry<String, String> entry = it.next();
150  if (!allowedParameters.contains(entry.getKey())) {
151  it.remove();
152  }
153  }
154 
155  return parameterMap;
156  }
void putInMap(Map< String, String > map, String p_name)
Definition: RequestParameterService.java:158
static final List< String > ALLOWED_PARAMETER
Definition: RequestParameterService.java:47

◆ getParameterValue()

String org.xdi.oxauth.service.RequestParameterService.getParameterValue ( String  p_name)
inline
168  {
169  Pair<String, String> valueWithType = getParameterValueWithType(p_name);
170  if (valueWithType == null) {
171  return null;
172  }
173 
174  return valueWithType.getFirst();
175  }
Pair< String, String > getParameterValueWithType(String p_name)
Definition: RequestParameterService.java:177

◆ getParameterValueWithType()

Pair<String, String> org.xdi.oxauth.service.RequestParameterService.getParameterValueWithType ( String  p_name)
inline
177  {
178  String value = null;
179  String clazz = null;
180  final Object o = identity.getWorkingParameter(p_name);
181  if (o instanceof String) {
182  final String s = (String) o;
183  value = s;
184  clazz = String.class.getName();
185  } else if (o instanceof Integer) {
186  final Integer i = (Integer) o;
187  value = i.toString();
188  clazz = Integer.class.getName();
189  } else if (o instanceof Boolean) {
190  final Boolean b = (Boolean) o;
191  value = b.toString();
192  clazz = Boolean.class.getName();
193  }
194 
195  return new Pair<String, String>(value, clazz);
196  }
Identity identity
Definition: RequestParameterService.java:75

◆ getTypedValue()

Object org.xdi.oxauth.service.RequestParameterService.getTypedValue ( String  stringValue,
String  type 
)
inline
198  {
199  if (StringHelper.equals(Boolean.class.getName(), type)) {
200  return Boolean.valueOf(stringValue);
201  } else if (StringHelper.equals(Integer.class.getName(), type)) {
202  return Integer.valueOf(stringValue);
203  }
204 
205  return stringValue;
206  }

◆ parametersAsString()

String org.xdi.oxauth.service.RequestParameterService.parametersAsString ( final Map< String, String >  parameterMap) throws UnsupportedEncodingException
inline
120  {
121  final StringBuilder sb = new StringBuilder();
122  final Set<Entry<String, String>> set = parameterMap.entrySet();
123  for (Map.Entry<String, String> entry : set) {
124  final String value = (String) entry.getValue();
125  if (StringUtils.isNotBlank(value)) {
126  sb.append(entry.getKey()).append("=").append(URLEncoder.encode(value, Util.UTF8_STRING_ENCODING)).append("&");
127  }
128  }
129 
130  String result = sb.toString();
131  if (result.endsWith("&")) {
132  result = result.substring(0, result.length() - 1);
133  }
134  return result;
135  }

◆ putInMap()

void org.xdi.oxauth.service.RequestParameterService.putInMap ( Map< String, String >  map,
String  p_name 
)
inlineprivate
158  {
159  if (map == null) {
160  return;
161  }
162 
163  String value = getParameterValue(p_name);
164 
165  map.put(p_name, value);
166  }
String getParameterValue(String p_name)
Definition: RequestParameterService.java:168

メンバ詳解

◆ ALLOWED_PARAMETER

final List<String> org.xdi.oxauth.service.RequestParameterService.ALLOWED_PARAMETER
static
初期値:
= Collections.unmodifiableList(Arrays.asList(
AuthorizeRequestParam.SCOPE,
AuthorizeRequestParam.RESPONSE_TYPE,
AuthorizeRequestParam.CLIENT_ID,
AuthorizeRequestParam.REDIRECT_URI,
AuthorizeRequestParam.STATE,
AuthorizeRequestParam.RESPONSE_MODE,
AuthorizeRequestParam.NONCE,
AuthorizeRequestParam.DISPLAY,
AuthorizeRequestParam.PROMPT,
AuthorizeRequestParam.MAX_AGE,
AuthorizeRequestParam.UI_LOCALES,
AuthorizeRequestParam.ID_TOKEN_HINT,
AuthorizeRequestParam.LOGIN_HINT,
AuthorizeRequestParam.ACR_VALUES,
AuthorizeRequestParam.SESSION_ID,
AuthorizeRequestParam.REQUEST,
AuthorizeRequestParam.REQUEST_URI,
AuthorizeRequestParam.ORIGIN_HEADERS,
AuthorizeRequestParam.CODE_CHALLENGE,
AuthorizeRequestParam.CODE_CHALLENGE_METHOD,
AuthorizeRequestParam.CUSTOM_RESPONSE_HEADERS,
AuthorizeRequestParam.CLAIMS))

◆ appConfiguration

AppConfiguration org.xdi.oxauth.service.RequestParameterService.appConfiguration
private

◆ identity

Identity org.xdi.oxauth.service.RequestParameterService.identity
private

◆ log

Logger org.xdi.oxauth.service.RequestParameterService.log
private

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