congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
OpenIDAuthenticationToken.getIdentityUrl
Code IndexAdd Tabnine to your IDE (free)

How to use
getIdentityUrl
method
in
org.springframework.security.openid.OpenIDAuthenticationToken

Best Java code snippets using org.springframework.security.openid.OpenIDAuthenticationToken.getIdentityUrl (Showing top 11 results out of 315)

origin: spring-projects/spring-security

/**
 * Handles the creation of the final <tt>Authentication</tt> object which will be
 * returned by the provider.
 * <p>
 * The default implementation just creates a new OpenIDAuthenticationToken from the
 * original, but with the UserDetails as the principal and including the authorities
 * loaded by the UserDetailsService.
 *
 * @param userDetails the loaded UserDetails object
 * @param auth the token passed to the authenticate method, containing
 * @return the token which will represent the authenticated user.
 */
protected Authentication createSuccessfulAuthentication(UserDetails userDetails,
    OpenIDAuthenticationToken auth) {
  return new OpenIDAuthenticationToken(userDetails,
      this.authoritiesMapper.mapAuthorities(userDetails.getAuthorities()),
      auth.getIdentityUrl(), auth.getAttributes());
}
origin: org.apache.rave/rave-core

  @Override
  public UserDetails loadUserDetails(OpenIDAuthenticationToken token) throws UsernameNotFoundException {
    final String openId = token.getIdentityUrl();
    User user = this.getUserByOpenId(openId);
    if (user == null) {
      log.info("Open ID User with URL "+openId+" was not found!");
      throw new UsernameNotFoundException("Open ID User with URL "+openId+" was not found!");
    }
    return user;
  }
}
origin: mkuthan/example-spring

public Builder withAuthenticationToken(OpenIDAuthenticationToken token) {
  this.username = token.getIdentityUrl();
  for (OpenIDAttribute attribute : token.getAttributes()) {
    if (attribute.getName().equals("email")) {
      this.email = attribute.getValues().get(0);
    }
    if (attribute.getName().equals("firstname")) {
      this.firstname = attribute.getValues().get(0);
    }
    if (attribute.getName().equals("lastname")) {
      this.lastname = attribute.getValues().get(0);
    }
    if (attribute.getName().equals("fullname")) {
      this.fullname = attribute.getValues().get(0);
    }
  }
  return this;
}
origin: stackoverflow.com

OpenIDAuthenticationToken newAuthentication = new OpenIDAuthenticationToken(userDetails, userDetails.getAuthorities(), openidAuthenticationToken.getIdentityUrl(), openidAuthenticationToken.getAttributes());
origin: org.springframework.security/spring-security-openid

/**
 * Handles the creation of the final <tt>Authentication</tt> object which will be
 * returned by the provider.
 * <p>
 * The default implementation just creates a new OpenIDAuthenticationToken from the
 * original, but with the UserDetails as the principal and including the authorities
 * loaded by the UserDetailsService.
 *
 * @param userDetails the loaded UserDetails object
 * @param auth the token passed to the authenticate method, containing
 * @return the token which will represent the authenticated user.
 */
protected Authentication createSuccessfulAuthentication(UserDetails userDetails,
    OpenIDAuthenticationToken auth) {
  return new OpenIDAuthenticationToken(userDetails,
      this.authoritiesMapper.mapAuthorities(userDetails.getAuthorities()),
      auth.getIdentityUrl(), auth.getAttributes());
}
origin: org.apache.rave/rave-web

@Override
public void onAuthenticationFailure(HttpServletRequest request, HttpServletResponse response, AuthenticationException exception) throws IOException, ServletException {
  if(exception instanceof UsernameNotFoundException
    && exception.getAuthentication() instanceof OpenIDAuthenticationToken
    && ((OpenIDAuthenticationToken)exception.getAuthentication()).getStatus().equals(OpenIDAuthenticationStatus.SUCCESS)) {
    
    OpenIDAuthenticationToken token = (OpenIDAuthenticationToken)exception.getAuthentication();
    String url = token.getIdentityUrl();
    User user = createTemporaryUser(token, url);
    request.getSession(true).setAttribute(ModelKeys.NEW_USER, user);
    DefaultRedirectStrategy redirectStrategy = new DefaultRedirectStrategy();
    log.info("Redirecting to new user account creation page");
    super.setRedirectStrategy(redirectStrategy);
    redirectStrategy.sendRedirect(request, response, "/"+ViewNames.CREATE_ACCOUNT_PAGE);
    return;
  } else {
    super.onAuthenticationFailure(request, response, exception);
  }
}
origin: mkuthan/example-spring

@Override
public UserDetails loadUserDetails(OpenIDAuthenticationToken token) throws UsernameNotFoundException {
  String identity = token.getIdentityUrl();
  UserIdentifier identifier = new UserIdentifier(identity);
  User user = userRepository.findByIdentifier(identifier);
  if (user != null) {
    // TODO: update account
  } else {
    // TODO: add user
  }
  Builder builder = new Builder().withAuthenticationToken(token);
  if (user != null) {
    for (RoleIdentifier role : user.getRoles()) {
      builder.addGrantedAuthority(new SimpleGrantedAuthority(role.getIdentifier()));
    }
  }
  return builder.build();
}
origin: com.erudika/para-server

user.setIdentifier(token.getIdentityUrl());
user = loadUser(user);
  user.setName(fullName);
  user.setPassword(Utils.generateSecurityToken());
  user.setIdentifier(token.getIdentityUrl());
  String id = user.create();
  if (id == null) {
origin: Erudika/para

user.setIdentifier(token.getIdentityUrl());
user = loadUser(user);
  user.setName(fullName);
  user.setPassword(Utils.generateSecurityToken());
  user.setIdentifier(token.getIdentityUrl());
  String id = user.create();
  if (id == null) {
origin: com.erudika/para

user.setIdentifier(token.getIdentityUrl());
user = loadUser(user);
  user.setName(fullName);
  user.setPassword(new UUID().toString());
  user.setIdentifier(token.getIdentityUrl());
  String id = user.create();
  if (id == null) {
origin: pebbleblog/pebble

if (token.getStatus() == OpenIDAuthenticationStatus.SUCCESS) {
 String openId = token.getIdentityUrl();
 if (securityRealm.getUserForOpenId(openId) != null) {
  validationContext.addError("The OpenID supplied is already mapped to a user.");
org.springframework.security.openidOpenIDAuthenticationTokengetIdentityUrl

Popular methods of OpenIDAuthenticationToken

  • getAttributes
  • getStatus
  • <init>
  • getMessage
  • setAuthenticated
  • setDetails
  • getAuthorities
  • getName
  • getPrincipal
    Returns the principal value.

Popular in Java

  • Start an intent from android
  • startActivity (Activity)
  • getApplicationContext (Context)
  • onRequestPermissionsResult (Fragment)
  • GridBagLayout (java.awt)
    The GridBagLayout class is a flexible layout manager that aligns components vertically and horizonta
  • Runnable (java.lang)
    Represents a command that can be executed. Often used to run code in a different Thread.
  • KeyStore (java.security)
    KeyStore is responsible for maintaining cryptographic keys and their owners. The type of the syste
  • SQLException (java.sql)
    An exception that indicates a failed JDBC operation. It provides the following information about pro
  • JComboBox (javax.swing)
  • Table (org.hibernate.mapping)
    A relational table
  • CodeWhisperer alternatives
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

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