From ce517821f2f9d44877f288adaf10b43cefd65d1b Mon Sep 17 00:00:00 2001 From: mo khan Date: Thu, 27 Feb 2025 16:25:09 -0700 Subject: Stub out endpoints for OIDC/OAuth metadata endpoints --- README.md | 1 - bin/idp | 16 +++++++++++++++- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 1930095b..43d3390a 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,6 @@ 3. API Gateway * using golang reverse proxy and one of the new policy dsl's - ## Identity Provider (SAML IdP) This is a tiny SAML Identity Provider for testing out interactions with diff --git a/bin/idp b/bin/idp index 46c2cf9e..6a632af1 100755 --- a/bin/idp +++ b/bin/idp @@ -70,11 +70,26 @@ class IdentityProvider [200, { 'Content-Type' => "application/samlmetadata+xml" }, [xml]] end + # GET /.well-known/oauth-authorization-server + def oauth_metadata + [200, { 'Content-Type' => "application/json" }, ["{}"]] + end + + # GET /.well-known/openid-configuration + def openid_metadata + [200, { 'Content-Type' => "application/json" }, ["{}"]] + end + + # auth service def call(env) path = env['PATH_INFO'] case env['REQUEST_METHOD'] when 'GET' case path + when '/.well-known/openid-configuration' + return openid_metadata + when '/.well-known/oauth-authorization-server' + return oauth_metadata when "/metadata.xml" return metadata when "/sessions/new" @@ -131,7 +146,6 @@ class IdentityProvider [200, { 'Content-Type' => "text/html" }, [html]] end - def not_found [404, {}, []] end -- cgit v1.2.3