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

Self-contained Magic Link Authenticator #25

Merged
merged 59 commits into from
Nov 24, 2022

Conversation

Yoshani
Copy link
Contributor

@Yoshani Yoshani commented Oct 26, 2022

Purpose

In the current implementation, the MagicLink authenticator is dependent on the identifier first to authenticate and resolve the user. But ideally, we should improve the MagicLink authenticator to embed the functionality of the identifier first authenticator to resolve the user using a given identifier.

This PR introduces identifier first capabilities into the Magic Link Authenticator.

Related Issues

Related PRs

@jenkins-is-staging
Copy link

@jenkins-is-staging
Copy link

PR builder completed
Link: https://github.com/wso2/product-is/actions/runs/3520393972
Status: failure

@jenkins-is-staging
Copy link

@jenkins-is-staging
Copy link

PR builder completed
Link: https://github.com/wso2/product-is/actions/runs/3521421897
Status: success

Copy link

@jenkins-is-staging jenkins-is-staging left a comment

Choose a reason for hiding this comment

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

Approving the pull request based on the successful pr build https://github.com/wso2/product-is/actions/runs/3521421897

chamathns
chamathns previously approved these changes Nov 23, 2022
chamathns
chamathns previously approved these changes Nov 23, 2022
@Yoshani
Copy link
Contributor Author

Yoshani commented Nov 24, 2022

Manual Testing

Manual test round performed and verified.

@@ -1,18 +1,20 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
~ Copyright (c) 2022, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
~ Copyright (c) 2022, WSO2 LLC. (http://www.wso2.org) All Rights Reserved.
Copy link
Contributor

Choose a reason for hiding this comment

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

Fix the licence header

@@ -1,18 +1,20 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
~ Copyright (c) 2021, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
~ Copyright (c) 2021, WSO2 LLC. (http://www.wso2.org) All Rights Reserved.
Copy link
Contributor

Choose a reason for hiding this comment

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

Fix the licence header

@@ -0,0 +1,79 @@
/*
* Copyright (c) 2022, WSO2 LLC. (http://www.wso2.org) All Rights Reserved.
Copy link
Contributor

Choose a reason for hiding this comment

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

Fix licence header

@@ -1,7 +1,7 @@
/*
* Copyright (c) 2021, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
* Copyright (c) 2021, WSO2 LLC. (http://www.wso2.org) All Rights Reserved.
Copy link
Contributor

Choose a reason for hiding this comment

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

Fix header

@@ -1,7 +1,7 @@
/*
* Copyright (c) 2021, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
* Copyright (c) 2021, WSO2 LLC. (http://www.wso2.org) All Rights Reserved.
Copy link
Contributor

Choose a reason for hiding this comment

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

Fix header

* This method is used to resolve the user from authentication response from identifier handler.
*
* @param request The httpServletRequest.
* @param context The authentication context.
Copy link
Contributor

Choose a reason for hiding this comment

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

Add @return

@@ -1,9 +1,9 @@
/*
* Copyright (c) 2022, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
* Copyright (c) 2022, WSO2 LLC. (http://www.wso2.org) All Rights Reserved.
Copy link
Contributor

Choose a reason for hiding this comment

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

Fix header

private AuthenticationContext authenticationContext;

@Override
public AuthenticatorFlowStatus process(HttpServletRequest request, HttpServletResponse response,
Copy link
Contributor

Choose a reason for hiding this comment

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

Add method comments for public methods

if (context.isLogoutRequest()) {
return AuthenticatorFlowStatus.SUCCESS_COMPLETED;
}
if (getName().equals(context.getProperty(FrameworkConstants.LAST_FAILED_AUTHENTICATOR))) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Use StringUtils. equals() to avoid NPE

@Yoshani Yoshani mentioned this pull request Jul 5, 2023
@Yoshani
Copy link
Contributor Author

Yoshani commented Jul 5, 2023

Comments fixed by #33

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.

5 participants