Skip to content
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

Custom OAuth2 Authroziation Hardcoded in Database #11052

Open
Aiosa opened this issue Oct 8, 2024 · 1 comment · May be fixed by #11053
Open

Custom OAuth2 Authroziation Hardcoded in Database #11052

Aiosa opened this issue Oct 8, 2024 · 1 comment · May be fixed by #11053

Comments

@Aiosa
Copy link

Aiosa commented Oct 8, 2024

V6 brings support for custom OAuth2 flows. However, one still needs to manage database of users & their access rights. However, such data can be driven dynamically by external services, which is desirable in any bigger project where multiple such apps live together.

See CustomOAuth2AuthorizationConfig:

        var authenticatedPortalUser = loadPortalUser(oidcUser.getEmail(), oidcUser);   // fetches user from cbio DB based on email entry
        if (Objects.isNull(authenticatedPortalUser.cbioUser) || !authenticatedPortalUser.cbioUser.isEnabled()) {
            log.error("User: {} either not in db or not authorized", oidcUser.getEmail());
            throw new OAuth2AuthenticationException("user not authorized");              // throws error even if the user was sucessfully authenticated
        }
        ...

A desirable way of doing this would be an ability to provide custom logics for the authentication and authorization resolution.

@Aiosa
Copy link
Author

Aiosa commented Oct 8, 2024

There are no tests since it does not introduce new functionality. It introduces an ability to bring a new functionality, but current tests should just catch all issues.

@Aiosa Aiosa linked a pull request Oct 8, 2024 that will close this issue
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant