Skip to content

Add AuthenticationConverter interface #5340

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

Closed
wants to merge 226 commits into from
Closed

Add AuthenticationConverter interface #5340

wants to merge 226 commits into from

Conversation

edeandrea
Copy link
Contributor

@edeandrea edeandrea commented May 11, 2018

  • Adding an AuthenticationConverter interface
  • Retro-fitting ServerFormLoginAuthenticationConverter, ServerHttpBasicAuthenticationConverter,
    and ServerOAuth2LoginAuthenticationTokenConverter to implement AuthenticationConverter
  • Deprecate existing AuthenticationWebFilter.setAuthenticationConverter
    and add overloaded one which takes AuthenticationConverter

Fixes gh-5338

- Adding an AuthenticationConverter interface
- Retro-fitting ServerFormLoginAuthenticationConverter, ServerHttpBasicAuthenticationConverter,
and ServerOAuth2LoginAuthenticationTokenConverter to implement AuthenticationConverter
- Deprecate existing AuthenticationWebFilter.setAuthenticationConverter
and add overloaded one which takes AuthenticationConverter

Fixes gh-5338
@rwinch rwinch added this to the 5.1.0.M2 milestone May 11, 2018
@rwinch rwinch modified the milestones: 5.1.0.M2, 5.1.0.RC1 Jul 26, 2018
@edeandrea
Copy link
Contributor Author

Hi @rwinch just a gentle ping to see if this PR needs any more polish or anything.

@rwinch
Copy link
Member

rwinch commented Aug 14, 2018

@edeandrea Thanks for the ping. I haven't had time to review this in detail. A few things that jump to my attention

  • Since your submission the PR cannot be merged due to conflicts. Sorry for taking so long to look at this. Can you please rebase?
  • I think I would prefer that AuthenticationConverter not implement Function. Instead the old setter with a function should just adapt the code to the AuthenticationConverter interface.
  • The AuthenticationConverter should have a method named convert in it.
  • We should rename the type to be ServerAuthenticationConverter

edeandrea and others added 21 commits August 16, 2018 21:52
This reverts commit 9fe0f50.

The original commit was accidentally pushed prior to PR. We attempted
to revert the commit hoping the PR would open again. This did not work.
We are going to do a Polish commit instead.

Issue: gh-5355
izeye and others added 24 commits August 16, 2018 21:55
Commit 884fdbf performed some manual edits of this file which
means running the rncToXsd task causes this file to change. This
commit regenerates the file properly.

Fixes: gh-5640
Adjusted return type of #decoder(JwtDecoder) and #jwkSetUri(String)
to return the JwtDecoder itself. Added new method #and() that returns
the enclosing OAuth2ResourceServerConfigurer.

Fixes gh-5595
OIDC Provider Configuration is now being used to create more than just
ClientRegistration instances. Also, the endpoint is being addressed in
more contexts than just the client.

To that end, this refactors OidcConfigurationProvider in the config
project to ClientRegistrations in the oauth2-client project.

Fixes: gh-5647
Changeset 46bb855 (#4094) removed websocket chat
sample in favor of spring-session one. This commit
updates spring-security documentation link to
point to the up-to-date sample location
This introduces OAuth2TokenValidator which allows the customization of
validation steps that need to be performing when decoding a string
token to a Jwt.

At this point, two validators, JwtTimestampValidator and
JwtIssuerValidator, are available for use.

Fixes: gh-5133
The current name of createDelegatingJwtValidator is not intuitive. The
name implies it is just creating a DelegatingOAuth2TokenValidator with
no mention that JwtTimestampValidator is being added.

To resolve this, the arguments have been removed and only
JwtTimestampValidator is added. User's needing additional validators can
add the result of this method to DelegatingOAuth2TokenValidator along with
the additional validators they wish to use. The method name has been
renamed to createDefault which now accurately reflects what is created.
There is no need to have JwtValidator at the end of the method since
the method is located in JwtValidators.

The commit also adds createDefaultWithIssuer for creating with a specific issuer.

Issue: gh-5133
@edeandrea
Copy link
Contributor Author

edeandrea commented Aug 17, 2018

Apologies I think I messed something up here. I think I accidentally merged instead of rebasing. I'll start over with a new PR.

@rwinch
Copy link
Member

rwinch commented Aug 17, 2018

You should be able to recover from the merge by looking at your reflog. Alternatively, you can save this work in another branch temporarily. Note the sha ids of the commits you made. Come back to this branch and do a git reset --hard origin/master. Then do a git cherry-pick <sha-id> for each commit you had. Then you can do a git push -f to the branch this PR is on to update the PR.

If you do want to start a new PR, please close this one out.

@edeandrea
Copy link
Contributor Author

Re-done with #5689

@edeandrea edeandrea closed this Aug 17, 2018
@edeandrea edeandrea deleted the gh-5338 branch August 17, 2018 22:57
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.