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

Re-design oxd Connect part to work inside user-agent instead of as backchannel app. #462

Open
yuriyz opened this issue Apr 15, 2020 · 4 comments
Assignees
Milestone

Comments

@yuriyz
Copy link
Contributor

yuriyz commented Apr 15, 2020

Historically oxd was created to work as back-channel app via sockets. Later we introduced oxd-https-extension which later merged into oxd making http as main transport and removed sockets. oxd commands were designed as back-channel calls at that time. Now when oxd can work inside user-agent it should take advantage of it.

Remove current (in 5.x, in 4.3 mark as deprecated):

  • /get-authorization-url
  • /get-tokens-by-code
  • /get-logout-uri

Instead we should have

  • /authorize which should redirect to AS Authorization Endpoint and on redirect back depending on type of the flow fetch token (or skip if it's Implicit Flow) and then validate it.
  • /end-session

In this way oxd will have full control of the process and we will not have questions like how oxd should match UserInfo sub with id_token sub? (see #441 (comment)).

cc @nynymike

@yuriyz yuriyz added this to the 4.2 milestone Apr 15, 2020
@yuriyz yuriyz modified the milestones: 4.2, Future, 4.3 Apr 15, 2020
@yuriyz
Copy link
Contributor Author

yuriyz commented Apr 15, 2020

@nynymike I propose to make it in 4.3. Since it's not major release we can leave /get-authorization-url and /get-tokens-by-code commands for backwards compatibility and completely remove in 5.x release.

@duttarnab
Copy link
Collaborator

@yuriyz , what I understand from /authorize is:

redirect to AS Authorization Endpoint --> user will enter username/password on login screen --> It will redirect back with code, id_token, access_token (depending on the flow) and validate --> call token endpoint (if required) and validate the token.

I am confused if we need directly need to redirect to AS Authorization Endpoint and submit username/password from the screen or we need do it using below java code passing userId and other parameters.

private AuthorizationResponse requestAuthorization(final String userId, final String userSecret, final String redirectUri,
                                                       List<ResponseType> responseTypes, List<String> scopes, String clientId, String nonce) {
        String state = UUID.randomUUID().toString();

        AuthorizationRequest authorizationRequest = new AuthorizationRequest(responseTypes, clientId, scopes, redirectUri, nonce);
        authorizationRequest.setState(state);

        AuthorizationResponse authorizationResponse = authenticateResourceOwnerAndGrantAccess(
                authorizationEndpoint, authorizationRequest, userId, userSecret);

           return authorizationResponse;
    }

@yuriyz
Copy link
Contributor Author

yuriyz commented Nov 29, 2020

When òxd /authorize endpoint is hit, we should construct authorization url and redirect it directly (perform HTTP redirect). User enters creds on AS side (its not part of oxd). After authn/authz is performed response has to be redirected to oxd (redirect_url should point to oxd) and oxd has to perform all validations.

@yuriyz
Copy link
Contributor Author

yuriyz commented Nov 29, 2020

Goal is to perform front channel calls, not backchannel as we do it now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants