Replies: 1 comment 4 replies
-
I was able to get this to work, but it required a lot of hackery and several steps to bypass things. I had to set the following in appsettings.json of the AppHost project
The next trick to this is to add a custom IDistributedApplicationLifecycleHook something like....
Then you have to register that in Program with....
So let's break down why all this is necessary.... Here you can see that whenever the dashboard is secured (which it is by default) then it automatically sets... AppHost:OtlpApiKey to a generated token We actually want it to do all of that EXCEPT set the BrowserToken, so the modification to the AppHost section of appsettings.json prevents this block from running while still setting the things we need, although, not in a way that you would ever want to use outside of this testing setup. Now let's take a look at why we need the custom lifecycle hook... Here we see that Dashboard:Frontend_AuthType will only ever get set to BrowserToken or Unsecured so the only way I could see that we could override that was with the custom lifecycle hook that runs AFTER this one to set that to OpenIdConnect. If it were supported here then I believe it would be easy enough to just copy values for Dashboard:Frontend:OpenIdConnect and Authentication:Schemes:OpenIdConnect into the EnvironmentCallbackContext and you would be done. Now, onto the questions.... This appears to work just fine so was it by design for some reason that it appears to be explicitly ignored or just an oversight when OIDC was added? |
Beta Was this translation helpful? Give feedback.
-
I'm playing with the starter template and trying to enable OIDC login to the dashboard, but no matter what I do it continues to used BrowserToken. I read something in the docs the leads me to believe OIDC can only be setup for standalone mode, but why is that the case? It looks like there's a clean split between where the resources send data to the app host and the user login to the app host so I'm trying to understand if this is something that currently works and if so how you set it up.
Beta Was this translation helpful? Give feedback.
All reactions