Java Code Examples for

The following examples show how to use These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source Project: crnk-example   Source File:    License: Apache License 2.0 6 votes vote down vote up
private OAuth2ClientAuthenticationProcessingFilter ssoFilter(ClientResources client, String path) {
	OAuth2RestTemplate oAuth2RestTemplate = new OAuth2RestTemplate(client.getClient(), oauth2ClientContext);

	UserInfoTokenServices tokenServices = new UserInfoTokenServices(client.getResource().getUserInfoUri(),

	OAuth2ClientAuthenticationProcessingFilter oAuth2ClientAuthenticationFilter =
			new OAuth2ClientAuthenticationProcessingFilter(path);
	oAuth2ClientAuthenticationFilter.setAuthenticationSuccessHandler(new SimpleUrlAuthenticationSuccessHandler() {
		public void onAuthenticationSuccess(HttpServletRequest request, HttpServletResponse response,
				Authentication authentication) throws IOException, ServletException {
			// TODO switch to tokens or find a way to return to last page on client
			super.onAuthenticationSuccess(request, response, authentication);

	return oAuth2ClientAuthenticationFilter;
Example 2
Source Project: sshd-shell-spring-boot   Source File:    License: Apache License 2.0 5 votes vote down vote up
protected void configure(HttpSecurity http) throws Exception {
    SimpleUrlAuthenticationSuccessHandler authSuccessHandler = new SimpleUrlAuthenticationSuccessHandler();
            .and().formLogin().defaultSuccessUrl("/test", true);
Example 3
Source Project: multitenancy   Source File:    License: Apache License 2.0 4 votes vote down vote up
public SimpleUrlAuthenticationSuccessHandler successHandler() {
    return new SimpleUrlAuthenticationSuccessHandler("/user/index");
Example 4
Source Project: hawkbit   Source File:    License: Eclipse Public License 1.0 4 votes vote down vote up
 * @return {@link AuthenticationSuccessHandler} bean
public AuthenticationSuccessHandler authenticationSuccessHandler() {
    return new SimpleUrlAuthenticationSuccessHandler();
Example 5
public SimpleUrlAuthenticationSuccessHandler pac4jAuthenticationSuccessHandler() {
	return new Pac4jAuthenticationSuccessHandler();