Add userinfo oauth endpoint (#32548)
This commit is contained in:
parent
0a599d08d8
commit
e1b7382ea6
8 changed files with 112 additions and 12 deletions
|
@ -3,12 +3,6 @@
|
|||
require 'rails_helper'
|
||||
|
||||
RSpec.describe 'The /.well-known/oauth-authorization-server request' do
|
||||
let(:protocol) { ENV.fetch('LOCAL_HTTPS', true) ? :https : :http }
|
||||
|
||||
before do
|
||||
host! Rails.configuration.x.local_domain
|
||||
end
|
||||
|
||||
it 'returns http success with valid JSON response' do
|
||||
get '/.well-known/oauth-authorization-server'
|
||||
|
||||
|
@ -22,11 +16,12 @@ RSpec.describe 'The /.well-known/oauth-authorization-server request' do
|
|||
grant_types_supported << 'refresh_token' if Doorkeeper.configuration.refresh_token_enabled?
|
||||
|
||||
expect(response.parsed_body).to include(
|
||||
issuer: root_url(protocol: protocol),
|
||||
issuer: root_url,
|
||||
service_documentation: 'https://docs.joinmastodon.org/',
|
||||
authorization_endpoint: oauth_authorization_url(protocol: protocol),
|
||||
token_endpoint: oauth_token_url(protocol: protocol),
|
||||
revocation_endpoint: oauth_revoke_url(protocol: protocol),
|
||||
authorization_endpoint: oauth_authorization_url,
|
||||
token_endpoint: oauth_token_url,
|
||||
userinfo_endpoint: oauth_userinfo_url,
|
||||
revocation_endpoint: oauth_revoke_url,
|
||||
scopes_supported: Doorkeeper.configuration.scopes.map(&:to_s),
|
||||
response_types_supported: Doorkeeper.configuration.authorization_response_types,
|
||||
response_modes_supported: Doorkeeper.configuration.authorization_response_flows.flat_map(&:response_mode_matches).uniq,
|
||||
|
@ -34,7 +29,7 @@ RSpec.describe 'The /.well-known/oauth-authorization-server request' do
|
|||
grant_types_supported: grant_types_supported,
|
||||
code_challenge_methods_supported: ['S256'],
|
||||
# non-standard extension:
|
||||
app_registration_endpoint: api_v1_apps_url(protocol: protocol)
|
||||
app_registration_endpoint: api_v1_apps_url
|
||||
)
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue