From 37e6e2cc191eca8724f27e90e58c46fe6fb6c493 Mon Sep 17 00:00:00 2001 From: Dan Milne Date: Fri, 15 May 2026 08:30:30 +1000 Subject: [PATCH] Show copy-pasteable OIDC env vars after creating an app Surfaces OIDC_CLIENT_ID/SECRET, discovery URL, provider name, and PKCE flag in a single textarea on the credentials flash so the client config can be dropped straight into a consuming app's .env file. Co-Authored-By: Claude Opus 4.7 (1M context) --- app/views/admin/applications/show.html.erb | 26 ++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/app/views/admin/applications/show.html.erb b/app/views/admin/applications/show.html.erb index e5681f7..390f5f0 100644 --- a/app/views/admin/applications/show.html.erb +++ b/app/views/admin/applications/show.html.erb @@ -25,6 +25,32 @@ Public clients do not have a client secret. PKCE is required. <% end %> + + <% env_lines = [] %> + <% env_lines << "OIDC_CLIENT_ID=#{flash[:client_id]}" %> + <% if flash[:client_secret] %> + <% env_lines << "OIDC_CLIENT_SECRET=#{flash[:client_secret]}" %> + <% elsif flash[:public_client] %> + <% env_lines << "OIDC_CLIENT_SECRET=" %> + <% end %> + <% env_lines << "OIDC_DISCOVERY_URL=#{OidcJwtService.issuer_url}" %> + <% env_lines << "OIDC_PROVIDER_NAME='Clinch'" %> + <% env_lines << "OIDC_REQUIRE_PKCE=#{@application.requires_pkce? ? 'true' : 'false'}" %> + +
+
+ Environment variables (copy & paste): + +
+ +
<% end %>