All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.xlrit.gears.server.security.internal.InternalAuthenticationConfigurer Maven / Gradle / Ivy

The newest version!
package com.xlrit.gears.server.security.internal;

import lombok.RequiredArgsConstructor;
import org.springframework.security.authentication.AuthenticationManager;
import org.springframework.security.config.annotation.SecurityConfigurer;
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
import org.springframework.security.oauth2.server.resource.web.authentication.BearerTokenAuthenticationFilter;
import org.springframework.security.web.DefaultSecurityFilterChain;

@RequiredArgsConstructor
class InternalAuthenticationConfigurer implements SecurityConfigurer {

	private final BearerConverter converter;

	@Override
	public void init(HttpSecurity http) {
		http.authenticationProvider(new InternalAuthenticationProvider(converter));
	}

	@Override
	public void configure(HttpSecurity http) {
		AuthenticationManager authenticationManager = http.getSharedObject(AuthenticationManager.class);
		http.addFilter(new BearerTokenAuthenticationFilter(authenticationManager));
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy