|
219 | 219 | end |
220 | 220 | end |
221 | 221 |
|
| 222 | + context 'when the issuer is configured to a non-root URL' do |
| 223 | + let(:non_root_issuer) { 'http://test.host/issuer/with/path' } |
| 224 | + |
| 225 | + before do |
| 226 | + value = non_root_issuer |
| 227 | + Doorkeeper::OpenidConnect.configure do |
| 228 | + issuer value |
| 229 | + end |
| 230 | + end |
| 231 | + |
| 232 | + it 'returns the configured issuer in the webfinger response' do |
| 233 | + get :webfinger, params: { resource: 'user@example.com' } |
| 234 | + data = JSON.parse(response.body) |
| 235 | + |
| 236 | + expect(data['links'].first['href']).to eq non_root_issuer |
| 237 | + end |
| 238 | + end |
| 239 | + |
222 | 240 | context 'when client_credentials is configured with both from_basic and from_params' do |
223 | 241 | before { Doorkeeper.configure { client_credentials :from_basic, :from_params } } |
224 | 242 |
|
@@ -366,28 +384,11 @@ def controller.logout_url |
366 | 384 | 'subject' => 'user@example.com', |
367 | 385 | 'links' => [ |
368 | 386 | 'rel' => 'http://openid.net/specs/connect/1.0/issuer', |
369 | | - 'href' => 'http://test.host/', |
| 387 | + 'href' => 'dummy', |
370 | 388 | ], |
371 | 389 | }.sort) |
372 | 390 | end |
373 | 391 |
|
374 | | - context 'when the discovery_url_options option is set for webfinger endpoint' do |
375 | | - before do |
376 | | - Doorkeeper::OpenidConnect.configure do |
377 | | - discovery_url_options do |request| |
378 | | - { webfinger: { host: 'alternate-webfinger.host' } } |
379 | | - end |
380 | | - end |
381 | | - end |
382 | | - |
383 | | - it 'uses the discovery_url_options option when generating the webfinger endpoint url' do |
384 | | - get :webfinger, params: { resource: 'user@example.com' } |
385 | | - data = JSON.parse(response.body) |
386 | | - |
387 | | - expect(data['links'].first['href']).to eq 'http://alternate-webfinger.host/' |
388 | | - end |
389 | | - end |
390 | | - |
391 | 392 | context 'when the discovery_url_options option uses the request for an endpoint' do |
392 | 393 | before do |
393 | 394 | Doorkeeper::OpenidConnect.configure do |
|
0 commit comments