-
Notifications
You must be signed in to change notification settings - Fork 327
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
ADFS support / top level config elements are only vouch
and oauth
#65
Comments
Doesn't look like there's a cookie domain there. Could you please post
your redacted config.yml and your nginx config.
Thanks
…On Tue, Feb 5, 2019, 2:32 AM Simon Gottschlag ***@***.*** wrote:
Hi,
Sorry if this is me not understanding Go. I've been looking at an issue
where my cookie.domain isn't being set for the cookies.
I've forked and built the project and added the following:
log.Debugf("temp debug - cookie: %v", cfg.Cfg.Cookie)
Which is returned like this:
time="2019-02-05T10:17:18Z" level=debug msg="temp debug - cookie:
{VouchCookie false true}"
I can see, at startup, that it is configured. Seems like cookie.go isn't
using the configuration set?
Am I just doing everything wrong here or is there a bug?
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#65>, or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABNK6wwSlx-HomwQ0s3QllCjkjts3iaVks5vKV2ugaJpZM4ai7J3>
.
|
This is the output:
When reading it from main it looks like this: (used %s instead of %v)
It really seems like I'm not getting the settings to other places other than cfg.go. This is the config.yml:
This is the nginx-config:
|
Thanks, could you please provide the nginx config for one of the sites
using the auth_request module
…On Tue, Feb 5, 2019, 3:06 AM Simon Gottschlag ***@***.*** wrote:
This is the output:
time="2019-02-05T10:58:53Z" level=debug msg="map[vouch:map[allowallusers:true loglevel:debug port:80 listen:0.0.0.0] oauth:map[scopes:[openid email profile] user_info_url:https://adfs.example.com/adfs/userinfo callback_url:https://auth.example.com/auth provider:oidc client_id:clientId token_url:https://adfs.example.com/adfs/oauth2/token/ auth_url:https://adfs.example.com/adfs/oauth2/authorize/ client_secret:***] cookie:map[httponly:false secure:false name:VouchCookieTest domain:example.com] headers:map[jwt:X-Vouch-Token querystring:access_token redirect:X-Vouch-Requested-URI] session:map[name:VouchSession]]"
When reading it from main it looks like this: (used %s instead of %v)
time="2019-02-05T10:58:53Z" level=debug msg="debug - main cfg {debug 0.0.0.0 %!s(int=80) [] [] %!s(bool=true) %!s(bool=false) {%!s(int=240) Vouch *** %!s(bool=true)} {VouchCookie %!s(bool=false) %!s(bool=true)} {X-Vouch-Token X-Vouch-User access_token X-Vouch-Requested-URI X-Vouch-Success} {data/vouch_bolt.db} {VouchSession ***} [] %!s(bool=false) %!s(bool=false)}"
It really seems like I'm not getting the settings to other places other
than cfg.go.
This is the config.yml:
vouch:
logLevel: debug
listen: 0.0.0.0
port: 80
AllowAllUsers: true
cookie:
name: VouchCookieTest
domain: example.com
secure: false
httpOnly: false
headers:
jwt: X-Vouch-Token
querystring: access_token
redirect: X-Vouch-Requested-URI
session:
name: VouchSession
oauth:
provider: oidc
client_id: clientId
client_secret: ***
auth_url: https://adfs.example.com/adfs/oauth2/authorize/
token_url: https://adfs.example.com/adfs/oauth2/token/
user_info_url: https://adfs.example.com/adfs/userinfo
scopes:
- openid
- email
- profile
callback_url: https://auth.example.com/auth
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#65 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABNK68TiTrasLB_9MQMcEvIv5cG7lhnjks5vKWWdgaJpZM4ai7J3>
.
|
Hi, I updated the above with the nginx-configuration. Is something missing form it? |
My apologies, the edits don't trigger a notification via email so I assumed you had not posted the config. You're using allowAllUsers without a domain. Could you try setting that to false and setting 'vouch.domains: - example.com' and see if that works. |
My bad! The issue with ADFS is that we're not receiving an email from the user info enpdoint, only getting a "sub". So I can't do that and still be able to login. |
That seems to be a common problem with oidc providers. Everyone follows the spec but the userinfo json blob is always a bit different. Vouch Proxy will not be able to construct a jwt if it's not able to parse the userinfo properly. We haven't had any questions regarding ADFS support. I can't find any mention of the json ADFS returns. Could you post that from your logs or provide a link to a spec. Are you running this in Azure? Happy to add the support for ADFS if you don't mind testing it for me over the next day or so. |
Hi, Sure! No problem to help with this. But I'm still not understanding why we're not seeing the correct configuration in cfg.Cfg when called from (for example) main.go or cookie.go. I am able to print out viper.AllSettings() but then I'm not seeing the defaults. The userinfo endpoint prints it like this:
The best thing would be if we could extract the id_token using implicit flow, or through the token endpoint. You will also have to change this to get it working (this was the first issue I hit): https://github.com/simongottschlag/vouch-proxy/blob/adfs_tests/handlers/handlers.go#L51 (Changing to URLEncoding) |
Thanks for that. I'll look at this closer later today.
…On Tue, Feb 5, 2019, 3:59 AM Simon Gottschlag ***@***.*** wrote:
Hi,
Sure! No problem to help with this. But I'm still not understanding why
we're not seeing the correct configuration in cfg.Cfg when called from (for
example) main.go or cookie.go. I am able to print out viper.AllSettings()
but then I'm not seeing the defaults.
The userinfo endpoint prints it like this:
time="2019-02-05T11:51:51Z" level=info msg="OpenID userinfo body: {\"sub\":\"gNrph/aMvDk6PPPt+EnqX+oXsIvosWQ0qJhesBj70vk=\"}"
The best thing would be if we could extract the id_token using implicit
flow, or through the token endpoint.
You will also have to change this to get it working (this was the first
issue I hit):
https://github.com/simongottschlag/vouch-proxy/blob/adfs_tests/handlers/handlers.go#L51
(Changing to URLEncoding)
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#65 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABNK69bhyrsnopwAy23z0mKXkysLED21ks5vKXI1gaJpZM4ai7J3>
.
|
Ok! Great! Trying my best at troubleshooting but really hard when I have no clue about the syntax |
Wonder if there's a config option on the ADFS side to get more user info..
https://stackoverflow.com/questions/45841537/how-to-configure-grafana-with-oauth-private-adfs
…On Tue, Feb 5, 2019, 4:06 AM Benjamin Foote ***@***.*** wrote:
Thanks for that. I'll look at this closer later today.
On Tue, Feb 5, 2019, 3:59 AM Simon Gottschlag ***@***.***
wrote:
> Hi,
>
> Sure! No problem to help with this. But I'm still not understanding why
> we're not seeing the correct configuration in cfg.Cfg when called from (for
> example) main.go or cookie.go. I am able to print out viper.AllSettings()
> but then I'm not seeing the defaults.
>
> The userinfo endpoint prints it like this:
>
> time="2019-02-05T11:51:51Z" level=info msg="OpenID userinfo body: {\"sub\":\"gNrph/aMvDk6PPPt+EnqX+oXsIvosWQ0qJhesBj70vk=\"}"
>
> The best thing would be if we could extract the id_token using implicit
> flow, or through the token endpoint.
>
> You will also have to change this to get it working (this was the first
> issue I hit):
> https://github.com/simongottschlag/vouch-proxy/blob/adfs_tests/handlers/handlers.go#L51
> (Changing to URLEncoding)
>
> —
> You are receiving this because you commented.
> Reply to this email directly, view it on GitHub
> <#65 (comment)>,
> or mute the thread
> <https://github.com/notifications/unsubscribe-auth/ABNK69bhyrsnopwAy23z0mKXkysLED21ks5vKXI1gaJpZM4ai7J3>
> .
>
|
Looks like lots of folks are struggling to get the userinfo endpoint to return more user info 😁 |
Yep! Lots of issues with it unfortunately. I've already tried combinations of keycloak-gatekeeper, envry/oidc-proxy (nginx+lua) and DEX. Gotten far but the last issue was keycloak-gatekeeper intercepting the Authorization-header which meant I'm not able to send basic auth to a backend after the authentication. The issue I'm seeing right now (after the URLEncoding fix) is that I'm not getting the cookies to domain.com and only auth.domain.com wich causes a loop. I'm not sure if I'm doing something wrong here or is there a problem with the cfg.Cfg in other modules? I'm only getting the "default" settings when printing it in main and cookie. |
Hi, Was able to fix the issue (at least for myself) with Cookie.Domain: #66 Here you have for the state to support ADFS as well: #67 Right now, I'm getting the following:
Which means we need to solve the issue with ADFS. I'll think about what the best way could be, but I know implicit works fine. (using it for Kubernetes) |
Hi, I've created a new PR wich seems to be working with ADFS: #68 You should most likely take a look at the code, since I've just made a mess. :) |
@simongottschlag unfortunately I'm not able to reproduce the behavior that you are seeing with setting the domain for the cookie. With |
I notice now that the config that you have offered has...
Which places |
vouch
and oauth
Hi,
Sorry if this is me not understanding Go. I've been looking at an issue where my cookie.domain isn't being set for the cookies.
I've forked and built the project and added the following:
log.Debugf("temp debug - cookie: %v", cfg.Cfg.Cookie)
Which is returned like this:
time="2019-02-05T10:17:18Z" level=debug msg="temp debug - cookie: {VouchCookie false true}"
I can see, at startup, that it is configured. Seems like cookie.go isn't using the configuration set?
Am I just doing everything wrong here or is there a bug?
The text was updated successfully, but these errors were encountered: