Further openid work

This commit is contained in:
bluepython508
2023-11-11 23:57:09 +00:00
parent 4107d37106
commit aaff151be7
8 changed files with 39 additions and 14 deletions

View File

@@ -1,11 +1,14 @@
defmodule SsoBsnWeb.Openid.ConfigurationController do
use SsoBsnWeb, :controller
use SsoBsnWeb, :controller
def config(conn, _params) do
conn |> json(%{
issuer: url(~p"/"),
authorization_endpoint: url(~p"/openid/authorize"),
token_endpoint: url(~p"/oauth/token")
})
end
def config(conn, _params) do
conn
|> json(%{
issuer: url(~p"/"),
authorization_endpoint: url(~p"/openid/authorize"),
token_endpoint: url(~p"/oauth/token"),
jwks_uri: url(~p"/openid/jwks"),
userinfo_endpoint: url(~p"/openid/userinfo")
})
end
end

View File

@@ -0,0 +1,14 @@
defmodule SsoBsnWeb.Webfinger do
use SsoBsnWeb, :controller
plug :put_resp_content_type, "application/jrd+json"
def webfinger(conn, %{ "resource" => <<"acct:", _::bitstring>> = resource_uri }) do
conn |> json(%{
subject: resource_uri,
links: [
%{ rel: "http://openid.net/specs/connect/1.0/issuer", href: url(~p"/") }
]
})
end
end