Fix webfinger discovery route
This commit is contained in:
parent
ab65617958
commit
24fd70676c
3 changed files with 4 additions and 4 deletions
|
|
@ -5,7 +5,7 @@ module Api
|
|||
jrd = {
|
||||
links: [{
|
||||
rel: OpenIDConnect::Discovery::Provider::Issuer::REL_VALUE,
|
||||
href: File.join(root_url, "api", "openid_connect")
|
||||
href: root_url
|
||||
}]
|
||||
}
|
||||
jrd[:subject] = params[:resource] if params[:resource].present?
|
||||
|
|
|
|||
|
|
@ -247,13 +247,13 @@ Diaspora::Application.routes.draw do
|
|||
resources :authorizations, only: %i(new create destroy)
|
||||
post "authorizations/new", to: "authorizations#new"
|
||||
|
||||
get ".well-known/webfinger", to: "discovery#webfinger"
|
||||
get ".well-known/openid-configuration", to: "discovery#configuration"
|
||||
get "jwks.json", to: "id_tokens#jwks"
|
||||
|
||||
get "user_info", to: "user_info#show"
|
||||
end
|
||||
end
|
||||
|
||||
get ".well-known/webfinger", to: "api/openid_connect/discovery#webfinger"
|
||||
get ".well-known/openid-configuration", to: "api/openid_connect/discovery#configuration"
|
||||
get "user_applications", to: "user_applications#index"
|
||||
end
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ describe Api::OpenidConnect::DiscoveryController, type: :controller do
|
|||
|
||||
it "should return a url to the openid-configuration" do
|
||||
json_body = JSON.parse(response.body)
|
||||
expect(json_body["links"].first["href"]).to eq("http://test.host/api/openid_connect")
|
||||
expect(json_body["links"].first["href"]).to eq("http://test.host/")
|
||||
end
|
||||
|
||||
it "should return the resource in the subject" do
|
||||
|
|
|
|||
Loading…
Reference in a new issue