1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
declare(strict_types=1); |
4
|
|
|
|
5
|
|
|
namespace DigitalCz\OpenIDConnect\Discovery; |
6
|
|
|
|
7
|
|
|
use DigitalCz\OpenIDConnect\Discovery\Traits\ParametersTrait; |
8
|
|
|
use JsonSerializable; |
9
|
|
|
|
10
|
|
|
final class ProviderMetadata implements JsonSerializable |
11
|
|
|
{ |
12
|
|
|
use ParametersTrait; |
13
|
|
|
|
14
|
|
|
private JWKs $JWKs; |
15
|
|
|
|
16
|
|
|
/** @param array<string, mixed> $metadata */ |
17
|
|
|
public function __construct(array $metadata, JWKs $JWKs) |
18
|
|
|
{ |
19
|
|
|
$this->parameters = $metadata; |
20
|
|
|
$this->JWKs = $JWKs; |
21
|
|
|
} |
22
|
|
|
|
23
|
|
|
public function issuer(): string |
24
|
|
|
{ |
25
|
|
|
return $this->ensure('issuer'); |
26
|
|
|
} |
27
|
|
|
|
28
|
|
|
public function authorizationEndpoint(): string |
29
|
|
|
{ |
30
|
|
|
return $this->ensure('authorization_endpoint'); |
31
|
|
|
} |
32
|
|
|
|
33
|
|
|
public function tokenEndpoint(): ?string |
34
|
|
|
{ |
35
|
|
|
return $this->get('token_endpoint'); |
36
|
|
|
} |
37
|
|
|
|
38
|
|
|
public function userinfoEndpoint(): ?string |
39
|
|
|
{ |
40
|
|
|
return $this->get('userinfo_endpoint'); |
41
|
|
|
} |
42
|
|
|
|
43
|
|
|
public function jwksUri(): string |
44
|
|
|
{ |
45
|
|
|
return $this->ensure('jwks_uri'); |
46
|
|
|
} |
47
|
|
|
|
48
|
|
|
public function registrationEndpoint(): ?string |
49
|
|
|
{ |
50
|
|
|
return $this->get('registration_endpoint'); |
51
|
|
|
} |
52
|
|
|
|
53
|
|
|
/** @return string[] */ |
54
|
|
|
public function scopesSupported(): array |
55
|
|
|
{ |
56
|
|
|
return $this->get('scopes_supported', []); |
57
|
|
|
} |
58
|
|
|
|
59
|
|
|
/** @return string[] */ |
60
|
|
|
public function responseTypesSupported(): array |
61
|
|
|
{ |
62
|
|
|
return $this->ensure('response_types_supported'); |
63
|
|
|
} |
64
|
|
|
|
65
|
|
|
/** @return string[] */ |
66
|
|
|
public function responseModesSupported(): array |
67
|
|
|
{ |
68
|
|
|
return $this->get('response_modes_supported', ['query', 'fragment']); |
69
|
|
|
} |
70
|
|
|
|
71
|
|
|
/** @return string[] */ |
72
|
|
|
public function grantTypesSupported(): array |
73
|
|
|
{ |
74
|
|
|
return $this->get('grant_types_supported', ['authorization_code', 'implicit']); |
75
|
|
|
} |
76
|
|
|
|
77
|
|
|
/** @return string[] */ |
78
|
|
|
public function acrValuesSupported(): array |
79
|
|
|
{ |
80
|
|
|
return $this->get('acr_values_supported', []); |
81
|
|
|
} |
82
|
|
|
|
83
|
|
|
/** @return string[] */ |
84
|
|
|
public function subjectTypesSupported(): array |
85
|
|
|
{ |
86
|
|
|
return $this->ensure('subject_types_supported'); |
87
|
|
|
} |
88
|
|
|
|
89
|
|
|
/** @return string[] */ |
90
|
|
|
public function idTokenSigningAlgValuesSupported(): array |
91
|
|
|
{ |
92
|
|
|
return $this->ensure('id_token_signing_alg_values_supported'); |
93
|
|
|
} |
94
|
|
|
|
95
|
|
|
/** @return string[] */ |
96
|
|
|
public function idTokenEncryptionAlgValuesSupported(): array |
97
|
|
|
{ |
98
|
|
|
return $this->get('id_token_encryption_alg_values_supported', []); |
99
|
|
|
} |
100
|
|
|
|
101
|
|
|
/** @return string[] */ |
102
|
|
|
public function idTokenEncryptionEncValuesSupported(): array |
103
|
|
|
{ |
104
|
|
|
return $this->get('id_token_encryption_enc_values_supported', []); |
105
|
|
|
} |
106
|
|
|
|
107
|
|
|
/** @return string[] */ |
108
|
|
|
public function userinfoSigningAlgValuesSupported(): array |
109
|
|
|
{ |
110
|
|
|
return $this->get('userinfo_signing_alg_values_supported', []); |
111
|
|
|
} |
112
|
|
|
|
113
|
|
|
/** @return string[] */ |
114
|
|
|
public function userinfoEncryptionAlgValuesSupported(): array |
115
|
|
|
{ |
116
|
|
|
return $this->get('userinfo_encryption_alg_values_supported', []); |
117
|
|
|
} |
118
|
|
|
|
119
|
|
|
/** @return string[] */ |
120
|
|
|
public function userinfoEncryptionEncValuesSupported(): array |
121
|
|
|
{ |
122
|
|
|
return $this->get('userinfo_encryption_enc_values_supported', []); |
123
|
|
|
} |
124
|
|
|
|
125
|
|
|
/** @return string[] */ |
126
|
|
|
public function requestObjectSigningAlgValuesSupported(): array |
127
|
|
|
{ |
128
|
|
|
return $this->get('request_object_signing_alg_values_supported', []); |
129
|
|
|
} |
130
|
|
|
|
131
|
|
|
/** @return string[] */ |
132
|
|
|
public function requestObjectEncryptionAlgValuesSupported(): array |
133
|
|
|
{ |
134
|
|
|
return $this->get('request_object_encryption_alg_values_supported', []); |
135
|
|
|
} |
136
|
|
|
|
137
|
|
|
/** @return string[] */ |
138
|
|
|
public function requestObjectEncryptionEncValuesSupported(): array |
139
|
|
|
{ |
140
|
|
|
return $this->get('request_object_encryption_enc_values_supported', []); |
141
|
|
|
} |
142
|
|
|
|
143
|
|
|
/** @return string[] */ |
144
|
|
|
public function tokenEndpointAuthMethodsSupported(): array |
145
|
|
|
{ |
146
|
|
|
return $this->get('token_endpoint_auth_methods_supported', ['client_secret_basic']); |
147
|
|
|
} |
148
|
|
|
|
149
|
|
|
/** @return string[] */ |
150
|
|
|
public function tokenEndpointAuthSigningAlgValuesSupported(): array |
151
|
|
|
{ |
152
|
|
|
return $this->get('token_endpoint_auth_signing_alg_values_supported', []); |
153
|
|
|
} |
154
|
|
|
|
155
|
|
|
/** @return string[] */ |
156
|
|
|
public function displayValuesSupported(): array |
157
|
|
|
{ |
158
|
|
|
return $this->get('display_values_supported', []); |
159
|
|
|
} |
160
|
|
|
|
161
|
|
|
/** @return string[] */ |
162
|
|
|
public function claimTypesSupported(): array |
163
|
|
|
{ |
164
|
|
|
return $this->get('claim_types_supported', []); |
165
|
|
|
} |
166
|
|
|
|
167
|
|
|
/** @return string[] */ |
168
|
|
|
public function claimsSupported(): array |
169
|
|
|
{ |
170
|
|
|
return $this->get('claims_supported', []); |
171
|
|
|
} |
172
|
|
|
|
173
|
|
|
public function serviceDocumentation(): string |
174
|
|
|
{ |
175
|
|
|
return $this->get('service_documentation'); |
176
|
|
|
} |
177
|
|
|
|
178
|
|
|
/** @return string[] */ |
179
|
|
|
public function claimsLocalesSupported(): array |
180
|
|
|
{ |
181
|
|
|
return $this->get('claims_locales_supported', []); |
182
|
|
|
} |
183
|
|
|
|
184
|
|
|
/** @return string[] */ |
185
|
|
|
public function uiLocalesSupported(): array |
186
|
|
|
{ |
187
|
|
|
return $this->get('ui_locales_supported', []); |
188
|
|
|
} |
189
|
|
|
|
190
|
|
|
public function claimsParameterSupported(): bool |
191
|
|
|
{ |
192
|
|
|
return $this->get('claims_parameter_supported', false); |
193
|
|
|
} |
194
|
|
|
|
195
|
|
|
public function requestParameterSupported(): bool |
196
|
|
|
{ |
197
|
|
|
return $this->get('request_parameter_supported', false); |
198
|
|
|
} |
199
|
|
|
|
200
|
|
|
public function requestUriParameterSupported(): bool |
201
|
|
|
{ |
202
|
|
|
return $this->get('request_uri_parameter_supported', false); |
203
|
|
|
} |
204
|
|
|
|
205
|
|
|
public function requireRequestUriRegistration(): bool |
206
|
|
|
{ |
207
|
|
|
return $this->get('require_request_uri_registration', false); |
208
|
|
|
} |
209
|
|
|
|
210
|
|
|
public function opPolicyUri(): string |
211
|
|
|
{ |
212
|
|
|
return $this->get('op_policy_uri'); |
213
|
|
|
} |
214
|
|
|
|
215
|
|
|
public function opTosUri(): string |
216
|
|
|
{ |
217
|
|
|
return $this->get('op_tos_uri'); |
218
|
|
|
} |
219
|
|
|
|
220
|
|
|
public function getJWKs(): JWKs |
221
|
|
|
{ |
222
|
|
|
return $this->JWKs; |
223
|
|
|
} |
224
|
|
|
} |
225
|
|
|
|