-
Notifications
You must be signed in to change notification settings - Fork 230
feat: add a way to check for specific OIDC claims #11603
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
Conversation
|
Thanks for opening this pull request! The maintainers of this repository would appreciate it if you would create a changelog item based on your changes. |
5a26656 to
b772704
Compare
mklos-kw
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested with: owncloud/web#12942
the guarded ocis endpoints returned 200 after OTP instead of 401.
878a383 to
2bf68d0
Compare
|
just rebased to master - no conflicts - no re-review needed |
f3d38c9 to
ef7be90
Compare
ef7be90 to
9e37dde
Compare
For now, only some hardcoded paths will check the claims (if there is a checker configured). If the check fails for those paths, the authentication will fail and it will return a 401 error
Signed-off-by: Julian Koberg <[email protected]>
Signed-off-by: Julian Koberg <[email protected]>
9b3e17c to
a8d744b
Compare
8b272a3 to
6fb682d
Compare
Signed-off-by: Julian Koberg <[email protected]>
6fb682d to
824a71d
Compare
|
For the mfa.go file, I think it's better to split the functions: on the one hand we have convenient "get & set" functions to deal with the data in the context, and on the other hand we have some functions dealing with HTTP headers. Side note, I think we need to test what happens if the |
I can do that. the context functions where originally in revas ctx package. I moved them for simplicity. Both of them are the main dish. I wanted an encapsulated package that one could use when introducing 2fa into another service. No other imports needed. But if you prefer to have the functionality split we can do so. Will make it more difficult to add 2fa to other services though...
Already did. This results in |
f04c1bf to
e984e02
Compare
Signed-off-by: Julian Koberg <[email protected]>
e984e02 to
dda6104
Compare
Signed-off-by: Julian Koberg <[email protected]>
2658192 to
04b829e
Compare
|
@jvillafanez I think I catched all your points. Please review again 🙏 |
|
|
I guess that, as the owner of the PR, I can't approve the changes myself (github doesn't let me). Code looks good, so it's good to merge to me 👍 |
feat: add a way to check for specific OIDC claims
feat: add a way to check for specific OIDC claims
feat: add a way to check for specific OIDC claims



Feature Updated
Feature updated as we current guarantee secure access with the old approach. We are using
usersandgroupsendpoint also for regular users. Only if you want to list all users you need 2fa. The new approach is as follows:Proxy middleware evaluates the context and adds a header to the request. If mfa is disabled the middleware will always set the header to
true. If mfa is enabled the middleware compares the acr value with the configured values and sets header totrueif one level matches. This way services do not need to care if mfa is enabled or disabled - they always assume it is enabled.Graph service reads the header and adjusts context. The handlers check the context when they enter sensitive parts of the code. This way we have full control which parts of the code we want to mfa protect.
We introduced a new
mfapackage so future services (e.g. ocdav service) can reuse the package when they introduce 2fa into their stack.(original comment hidden for readability)