congrats Icon
New! Tabnine Pro 14-day free trial
Start a free trial
Tabnine Logo
OAuth2AuthorizationCodeReactiveAuthenticationManager
Code IndexAdd Tabnine to your IDE (free)

How to use
OAuth2AuthorizationCodeReactiveAuthenticationManager
in
org.springframework.security.oauth2.client.authentication

Best Java code snippets using org.springframework.security.oauth2.client.authentication.OAuth2AuthorizationCodeReactiveAuthenticationManager (Showing top 9 results out of 315)

origin: spring-projects/spring-security

public OAuth2LoginReactiveAuthenticationManager(
    ReactiveOAuth2AccessTokenResponseClient<OAuth2AuthorizationCodeGrantRequest> accessTokenResponseClient,
    ReactiveOAuth2UserService<OAuth2UserRequest, OAuth2User> userService) {
  Assert.notNull(accessTokenResponseClient, "accessTokenResponseClient cannot be null");
  Assert.notNull(userService, "userService cannot be null");
  this.authorizationCodeManager = new OAuth2AuthorizationCodeReactiveAuthenticationManager(accessTokenResponseClient);
  this.userService = userService;
}
origin: spring-projects/spring-security

@Override
public Mono<Authentication> authenticate(Authentication authentication) {
  return Mono.defer(() -> {
    OAuth2AuthorizationCodeAuthenticationToken token = (OAuth2AuthorizationCodeAuthenticationToken) authentication;
    OAuth2AuthorizationExchangeValidator.validate(token.getAuthorizationExchange());
    OAuth2AuthorizationCodeGrantRequest authzRequest = new OAuth2AuthorizationCodeGrantRequest(
        token.getClientRegistration(),
        token.getAuthorizationExchange());
    return this.accessTokenResponseClient.getTokenResponse(authzRequest)
        .map(onSuccess(token));
  });
}
origin: spring-projects/spring-security

  private OAuth2AuthorizationCodeAuthenticationToken authenticate() {
    OAuth2AuthorizationExchange exchange = new OAuth2AuthorizationExchange(
        this.authorizationRequest.build(), this.authorizationResponse.build());
    OAuth2AuthorizationCodeAuthenticationToken token = new OAuth2AuthorizationCodeAuthenticationToken(
        this.registration.build(), exchange);
    return (OAuth2AuthorizationCodeAuthenticationToken) this.manager.authenticate(token).block();
  }
}
origin: apache/servicemix-bundles

@Override
public Mono<Authentication> authenticate(Authentication authentication) {
  return Mono.defer(() -> {
    OAuth2AuthorizationCodeAuthenticationToken token = (OAuth2AuthorizationCodeAuthenticationToken) authentication;
    OAuth2AuthorizationExchangeValidator.validate(token.getAuthorizationExchange());
    OAuth2AuthorizationCodeGrantRequest authzRequest = new OAuth2AuthorizationCodeGrantRequest(
        token.getClientRegistration(),
        token.getAuthorizationExchange());
    return this.accessTokenResponseClient.getTokenResponse(authzRequest)
        .map(onSuccess(token));
  });
}
origin: spring-projects/spring-security

/**
 * Gets the {@link ReactiveAuthenticationManager} to use. First tries an explicitly configured manager, and
 * defaults to {@link OAuth2AuthorizationCodeReactiveAuthenticationManager}
 *
 * @return the {@link ReactiveAuthenticationManager} to use
 */
private ReactiveAuthenticationManager getAuthenticationManager() {
  if (this.authenticationManager == null) {
    this.authenticationManager = new OAuth2AuthorizationCodeReactiveAuthenticationManager(new WebClientReactiveAuthorizationCodeTokenResponseClient());
  }
  return this.authenticationManager;
}
origin: spring-projects/spring-security

@Before
public void setup() {
  this.manager = new OAuth2AuthorizationCodeReactiveAuthenticationManager(this.accessTokenResponseClient);
}
origin: org.springframework.security/spring-security-config

/**
 * Gets the {@link ReactiveAuthenticationManager} to use. First tries an explicitly configured manager, and
 * defaults to {@link OAuth2AuthorizationCodeReactiveAuthenticationManager}
 *
 * @return the {@link ReactiveAuthenticationManager} to use
 */
private ReactiveAuthenticationManager getAuthenticationManager() {
  if (this.authenticationManager == null) {
    this.authenticationManager = new OAuth2AuthorizationCodeReactiveAuthenticationManager(new WebClientReactiveAuthorizationCodeTokenResponseClient());
  }
  return this.authenticationManager;
}
origin: apache/servicemix-bundles

public OAuth2LoginReactiveAuthenticationManager(
    ReactiveOAuth2AccessTokenResponseClient<OAuth2AuthorizationCodeGrantRequest> accessTokenResponseClient,
    ReactiveOAuth2UserService<OAuth2UserRequest, OAuth2User> userService) {
  Assert.notNull(accessTokenResponseClient, "accessTokenResponseClient cannot be null");
  Assert.notNull(userService, "userService cannot be null");
  this.authorizationCodeManager = new OAuth2AuthorizationCodeReactiveAuthenticationManager(accessTokenResponseClient);
  this.userService = userService;
}
origin: apache/servicemix-bundles

/**
 * Gets the {@link ReactiveAuthenticationManager} to use. First tries an explicitly configured manager, and
 * defaults to {@link OAuth2AuthorizationCodeReactiveAuthenticationManager}
 *
 * @return the {@link ReactiveAuthenticationManager} to use
 */
private ReactiveAuthenticationManager getAuthenticationManager() {
  if (this.authenticationManager == null) {
    this.authenticationManager = new OAuth2AuthorizationCodeReactiveAuthenticationManager(new WebClientReactiveAuthorizationCodeTokenResponseClient());
  }
  return this.authenticationManager;
}
org.springframework.security.oauth2.client.authenticationOAuth2AuthorizationCodeReactiveAuthenticationManager

Javadoc

An implementation of an org.springframework.security.authentication.AuthenticationProvider for OAuth 2.0 Login, which leverages the OAuth 2.0 Authorization Code Grant Flow. This org.springframework.security.authentication.AuthenticationProvider is responsible for authenticating an Authorization Code credential with the Authorization Server's Token Endpoint and if valid, exchanging it for an Access Token credential.

It will also obtain the user attributes of the End-User (Resource Owner) from the UserInfo Endpoint using an org.springframework.security.oauth2.client.userinfo.OAuth2UserService, which will create a Principal in the form of an OAuth2User. The OAuth2User is then associated to the OAuth2LoginAuthenticationTokento complete the authentication.

Most used methods

  • <init>
  • onSuccess
  • authenticate

Popular in Java

  • Making http requests using okhttp
  • scheduleAtFixedRate (Timer)
  • getSharedPreferences (Context)
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • Menu (java.awt)
  • Dictionary (java.util)
    Note: Do not use this class since it is obsolete. Please use the Map interface for new implementatio
  • Scanner (java.util)
    A parser that parses a text string of primitive types and strings with the help of regular expressio
  • SortedSet (java.util)
    SortedSet is a Set which iterates over its elements in a sorted order. The order is determined eithe
  • JLabel (javax.swing)
  • Loader (org.hibernate.loader)
    Abstract superclass of object loading (and querying) strategies. This class implements useful common
  • Top 17 Free Sublime Text Plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyStudentsTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now