-
Notifications
You must be signed in to change notification settings - Fork 44
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ambassador and oidc (identity server 4) #22
Comments
How many replicas are you running? For debugging it'll be much easier to launch 1 if not already doing so. If ambassador were making requests you would see some activity there.. |
1 replica and no redis for now. 3 replicas of ambassador, I will decrease to 1 for debugging on Monday and try again using ClusterIP endpoint versus https and let you know. |
Ok, I'll see if I can find my test setup I had and send it over too. |
Got some progress. As it often happens - my mistake, I had another auth service running from previous testing. But apart from that I changed https endpoint to service name and added namespace and port
And got some logs in eas, last line is:
Will check identity server logs again, try a few more things and come back with more info. |
Another potentially interesting thing. During token generation, I put Looking at eas logs, I've found
|
In Identity logs everything looks good:
So, I guess it's something in eas or ambassador, any ideas what to check? |
Maybe this line?
I didn't do any assertions, I mean I set |
Ok this sounds like some great progress! Was going to mention the redirect uri needs to be something the client browser can access. Given the message it seems you may have a time differential between the servers. For testing out the theory it appears you may be able to set |
Wow, you know your stuff :) it worked! |
@travisghansen thanks for your support! I am also happy to see I get all custom claims in logs like this (now I see time difference after you said it):
Is it possible to protect different endpoints based on user/tenant/group info? I am thinking something in the lines of creating multiple tokens with different Let me know if that sounds reasonable and if yes - please point me in the right direction 😊 Shall I open another issue? 😃 |
@mlushpenko great! I need to make some notes about the challenges you hit and make sure to get them documented. Can you share what you're using for the the Within the service itself I don't currently support per-route logic (https://github.com/travisghansen/external-auth-server/blob/master/DEVELOPMENT.md#ideas). I've considered it but it's not super high on the priority list right now. Some proxies let you configure things a bit more fine-grained than ambassador (which from a configuration standpoint I found extremely limiting). I've even had requests to effectively bind scopes to routes which is quite interesting but very specific. Having said all that, to build a custom Thanks for the patience and feedback to get it going with ambassador! Looking forward to more input :) |
Maybe I misunderstood, by 'different endpoints' do you mean completely different services, or do you mean specific urls/routes within a single service? |
I meant completely different services running on kubernetes or rather different instances of the same application that belong to different tenants. oidc is used to authenticate users to multiple web apps on our platform if that makes sense. Rough idea is to separate users who run data science workloads. Kubeflow has good ideas how to support that but we don't know when it will be ready and so far they are planning to use dex. With with my understanding, looks like dex won't work for us due to limited group support. So, researching if we can login to our identity provider, get group info and then use that info to either route to different instances of the same app or to integrate it with the application internal authorization system. I don't have clear idea/understanding yet, so kinda practicing to see what can work out. |
Looking at assertion examples and info from my comment #22 (comment), I was thinking that something like this will prohibit users from accessing the webapp if they are not in
And also for this specific token we could add policy circuit breaker:
And then, if we could add several tokens, I guess the whole authentication/authorization would work for multi-tenant environment or maybe I am just imagining things in my head 😆 (UPDATE after reading docs again): not several tokens, but multiple plugins if it's possible to configure several oidc plugins with a bit different configs |
I think I am quite close (haven't tested multiple oidc plugins yet). This is what I have, only relevant parts:
This allows the following:
just need to replace |
It worked! Multiple OIDC plugins with the same credentials worked, yoohoo!
versus
Now, I can loging to ambassador.hal24k.nl and my colleague |
Oh wow! That's a very creative setup. I'm going to have to read it over a few times to better understand what you're doing. I really like the general idea though! Did you mention what you're using for oidc provider? |
Ok, yeah I'm following what you're doing now, very cool. It sounds like the Also make sure to read the security implications with oidc sessions etc here if you haven't already: https://github.com/travisghansen/external-auth-server/blob/master/OAUTH_PLUGINS.md |
Indeed token is growing in size, I will check server-side if we agree this solution is suitable for our setup. Now that we have separation on tenant-level, each user will have their own instance of the app. I understand it would be possible to keep updating pcb rules all the time manually, but some dynamic setup would be much better, like this:
notice This is just an idea, looks like I have found my bottleneck. 95% sure authorization for multiple users will have to be handled by the app itself and in that case the whole external authentication service won't be needed. |
Or, I got another idea =D I guess I should stop here and not spam you anymore, thanks for your help so far! |
No problem! Keep me updated what works. noop won't get hit if one of the earlier plugins succeeds |
I see headers injection works:
Also configured ambassador:
and see that header actually gets propagated in ambassador:
but somehow ambassador ignores it in the end. Maybe need to open issue with them. |
Very cool sounds like you're very close! |
Crude ambassador documentation and support for url and header based envoy setups snapped in |
Reference #16 (comment)
Here are my eas logs (basically empty):
Could it be that token is wrong in a way and that's why ambassador can't talk to eas service?
here is my token config:
The text was updated successfully, but these errors were encountered: