Commit ce51782

mo khan <mo@mokhan.ca>
2025-02-27 23:25:09
Stub out endpoints for OIDC/OAuth metadata endpoints
1 parent dea9650
Changed files (2)
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
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