keycloak-service
公開メンバ関数 | 静的公開メンバ関数 | 静的公開変数類 | 非公開メンバ関数 | 静的非公開メンバ関数 | 非公開変数類 | 静的非公開変数類 | 全メンバ一覧
org.keycloak.protocol.oidc.utils.OIDCResponseType クラス
org.keycloak.protocol.oidc.utils.OIDCResponseType 連携図
Collaboration graph

公開メンバ関数

boolean hasResponseType (String responseType)
 
boolean isImplicitOrHybridFlow ()
 
boolean isImplicitFlow ()
 
String toString ()
 

静的公開メンバ関数

static OIDCResponseType parse (String responseTypeParam)
 
static OIDCResponseType parse (List< String > responseTypes)
 

静的公開変数類

static final String CODE = OIDCLoginProtocol.CODE_PARAM
 
static final String TOKEN = "token"
 
static final String ID_TOKEN = "id_token"
 
static final String NONE = "none"
 

非公開メンバ関数

 OIDCResponseType (List< String > responseTypes)
 

静的非公開メンバ関数

static void validateAllowedTypes (List< String > responseTypes)
 

非公開変数類

final List< String > responseTypes
 

静的非公開変数類

static final List< String > ALLOWED_RESPONSE_TYPES = Arrays.asList(CODE, TOKEN, ID_TOKEN, NONE)
 

詳解

著者
Marek Posolda

構築子と解体子

◆ OIDCResponseType()

org.keycloak.protocol.oidc.utils.OIDCResponseType.OIDCResponseType ( List< String >  responseTypes)
inlineprivate
41  {
43  }
final List< String > responseTypes
Definition: OIDCResponseType.java:38

関数詳解

◆ hasResponseType()

boolean org.keycloak.protocol.oidc.utils.OIDCResponseType.hasResponseType ( String  responseType)
inline
91  {
92  return responseTypes.contains(responseType);
93  }
final List< String > responseTypes
Definition: OIDCResponseType.java:38

◆ isImplicitFlow()

boolean org.keycloak.protocol.oidc.utils.OIDCResponseType.isImplicitFlow ( )
inline
100  {
102  }
static final String ID_TOKEN
Definition: OIDCResponseType.java:33
static final String CODE
Definition: OIDCResponseType.java:31
boolean hasResponseType(String responseType)
Definition: OIDCResponseType.java:91
static final String TOKEN
Definition: OIDCResponseType.java:32

◆ isImplicitOrHybridFlow()

boolean org.keycloak.protocol.oidc.utils.OIDCResponseType.isImplicitOrHybridFlow ( )
inline
96  {
98  }
static final String ID_TOKEN
Definition: OIDCResponseType.java:33
boolean hasResponseType(String responseType)
Definition: OIDCResponseType.java:91
static final String TOKEN
Definition: OIDCResponseType.java:32

◆ parse() [1/2]

static OIDCResponseType org.keycloak.protocol.oidc.utils.OIDCResponseType.parse ( String  responseTypeParam)
inlinestatic
46  {
47  if (responseTypeParam == null) {
48  throw new IllegalArgumentException("response_type is null");
49  }
50 
51  String[] responseTypes = responseTypeParam.trim().split(" ");
52  List<String> allowedTypes = new ArrayList<>();
53  for (String current : responseTypes) {
54  if (ALLOWED_RESPONSE_TYPES.contains(current)) {
55  allowedTypes.add(current);
56  } else {
57  throw new IllegalArgumentException("Unsupported response_type: " + responseTypeParam);
58  }
59  }
60 
61  validateAllowedTypes(allowedTypes);
62 
63  return new OIDCResponseType(allowedTypes);
64  }
static void validateAllowedTypes(List< String > responseTypes)
Definition: OIDCResponseType.java:76
final List< String > responseTypes
Definition: OIDCResponseType.java:38
static final List< String > ALLOWED_RESPONSE_TYPES
Definition: OIDCResponseType.java:36
OIDCResponseType(List< String > responseTypes)
Definition: OIDCResponseType.java:41

◆ parse() [2/2]

static OIDCResponseType org.keycloak.protocol.oidc.utils.OIDCResponseType.parse ( List< String >  responseTypes)
inlinestatic
66  {
67  OIDCResponseType result = new OIDCResponseType(new ArrayList<String>());
68  for (String respType : responseTypes) {
69  OIDCResponseType responseType = parse(respType);
70  result.responseTypes.addAll(responseType.responseTypes);
71  }
72 
73  return result;
74  }
static OIDCResponseType parse(String responseTypeParam)
Definition: OIDCResponseType.java:46
final List< String > responseTypes
Definition: OIDCResponseType.java:38
OIDCResponseType(List< String > responseTypes)
Definition: OIDCResponseType.java:41

◆ toString()

String org.keycloak.protocol.oidc.utils.OIDCResponseType.toString ( )
inline
106  {
107  StringBuilder builder = new StringBuilder();
108  boolean first = true;
109  for (String responseType : responseTypes) {
110  if (!first) {
111  builder.append(" ");
112  } else {
113  first = false;
114  }
115  builder.append(responseType);
116  }
117  return builder.toString();
118  }
final List< String > responseTypes
Definition: OIDCResponseType.java:38

◆ validateAllowedTypes()

static void org.keycloak.protocol.oidc.utils.OIDCResponseType.validateAllowedTypes ( List< String >  responseTypes)
inlinestaticprivate
76  {
77  if (responseTypes.size() == 0) {
78  throw new IllegalStateException("No responseType provided");
79  }
80  if (responseTypes.contains(NONE) && responseTypes.size() > 1) {
81  throw new IllegalArgumentException("'None' not allowed with some other response_type");
82  }
83 
84  // response_type value "token" alone is not mentioned in OIDC specification, however it is supported by OAuth2. We allow it just to be compatible with pure OAuth2 clients like swagger.ui
85 // if (responseTypes.contains(TOKEN) && responseTypes.size() == 1) {
86 // throw new IllegalArgumentException("Not supported to use response_type=token alone");
87 // }
88  }
final List< String > responseTypes
Definition: OIDCResponseType.java:38
static final String NONE
Definition: OIDCResponseType.java:34

メンバ詳解

◆ ALLOWED_RESPONSE_TYPES

final List<String> org.keycloak.protocol.oidc.utils.OIDCResponseType.ALLOWED_RESPONSE_TYPES = Arrays.asList(CODE, TOKEN, ID_TOKEN, NONE)
staticprivate

◆ CODE

final String org.keycloak.protocol.oidc.utils.OIDCResponseType.CODE = OIDCLoginProtocol.CODE_PARAM
static

◆ ID_TOKEN

final String org.keycloak.protocol.oidc.utils.OIDCResponseType.ID_TOKEN = "id_token"
static

◆ NONE

final String org.keycloak.protocol.oidc.utils.OIDCResponseType.NONE = "none"
static

◆ responseTypes

final List<String> org.keycloak.protocol.oidc.utils.OIDCResponseType.responseTypes
private

◆ TOKEN

final String org.keycloak.protocol.oidc.utils.OIDCResponseType.TOKEN = "token"
static

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