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

Modify the OIDC Authenticator to support Native SDK based Federation Flow in API Based Authentication #154

Merged
merged 12 commits into from
Oct 19, 2023

Conversation

dhaura
Copy link
Contributor

@dhaura dhaura commented Oct 17, 2023

Proposed changes in this pull request

  • This PR adds API based authentication capabilities to the OIDC connector to support Native SDK based Federation flow as follows.
    • Update getContextIdentifier() in order to return sessionDataKey in Native SDK based Federation flows.
    • Update requestAccessToken() in order to exchange an access tokens in Native SDK based Federation flows.
    • A new OAuthClientResponse NativeSDKBasedFederatedOAuthClientResponse.
    • A new method that facilitates the verification of a provided IdP as a trusted token issuer, in order to distinguish between the two federation modes as mentioned in Additional Context section.

Additional Context

  • With the introduction of API Based Authentication, WSO2 IS will provide support for two distinct federated authentication flows as outlined below.
    • Mode 1: External IDP is configured in IS and the authentication is handled through IS by redirecting to the external IDP.
    • Mode 2 - Native SDK based Federation: The app uses the IdP SDK for a social login option, for example, Google; and federating to Google directly from the app. Then, the client will exchange an access token received directly from the IdP, for an OAuth2 token from the IS side. (This flow will be executed, only if the IdP is a trusted token issuer.)

Related PRs

Related Issues

@dhaura dhaura changed the title Add API Based Authentication Modify the OIDC Authenticator to support API Based Authentication Ctd Oct 19, 2023
@dhaura dhaura changed the title Modify the OIDC Authenticator to support API Based Authentication Ctd Modify the OIDC Authenticator to support Native SDK based Federation Flow in API Based Authentication Oct 19, 2023
/**
* Copyright (c) 2015, WSO2 LLC. (https://www.wso2.com) All Rights Reserved.
/*
* Copyright (c) 2015, WSO2 LLC. (http://www.wso2.com).
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed year range should come in

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addressed with #184

/**
* Copyright (c) 2013, WSO2 LLC. (https://www.wso2.com) All Rights Reserved.
/*
* Copyright (c) 2013, WSO2 LLC. (http://www.wso2.com).
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

year range

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.


IdentityProviderProperty[] identityProviderProperties = externalIdentityProvider.getIdpProperties();
for (IdentityProviderProperty identityProviderProperty: identityProviderProperties) {
if (identityProviderProperty.getName().equals(IdPManagementConstants.IS_TRUSTED_TOKEN_ISSUER)) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use <constant>.equals(<variable>) pattern to avoid possible NPE

Copy link
Contributor Author

@dhaura dhaura May 7, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 this pull request may close these issues.

3 participants