-
Notifications
You must be signed in to change notification settings - Fork 375
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
Add api layer for api based authentication #2201
Add api layer for api based authentication #2201
Conversation
a6fe3bc
to
9ea1c2f
Compare
params.put(AUTHENTICATOR, new String[]{authenticatorIdSplit[0]}); | ||
params.put(IDP, new String[]{authenticatorIdSplit[1]}); | ||
} else { | ||
throw new AuthServiceClientException("Authenticator id is not in the correct format"); |
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.
Let's print the authenticator id.
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.
fixed
LOG.debug("Client error while handling authentication request", e); | ||
} | ||
return buildOAuthInvalidRequestError(e.getMessage()); | ||
} catch (AuthServiceException | InvalidRequestParentException | URISyntaxException e) { |
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.
Is InvalidRequestParentException a server error? The name of the class sounds different.
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.
its a client error. fixed.
|
||
private final AuthenticationService authenticationService = new AuthenticationService(); | ||
private final OAuth2AuthzEndpoint oAuth2AuthzEndpoint = new OAuth2AuthzEndpoint(); | ||
private static final String AUTHENTICATOR_IDP_SPLITTER = ":"; |
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.
Better move this constants to oAuthConstants
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.
fixed
List<Link> links = new ArrayList<>(); | ||
Link authnEpLink = new Link(); | ||
authnEpLink.setName("authentication"); | ||
String endpoint = "/oauth2/authn"; |
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.
Let's define these as constants in OAuthConstants.
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.
fixed. Moved to class level constants as currently these are not used in any other place
private boolean isApiBasedAuthenticationFlow(OAuth2Parameters oAuth2Parameters) { | ||
|
||
if (oAuth2Parameters == null) { | ||
log.debug("OAuth2Parameters is null. Returning false for isApiBasedAuthenticationFlow check."); |
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.
if (log.isDebugEnabled()) {
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.
fixed
9ea1c2f
to
287c1d5
Compare
287c1d5
to
64e2f67
Compare
PR builder started |
PR builder completed |
64e2f67
to
7d6a93c
Compare
PR builder started |
PR builder completed |
e041c61
to
595376e
Compare
595376e
to
ecf7eaa
Compare
ecf7eaa
to
b28c958
Compare
API layer for wso2/product-is#15684