Codota Logo
AuthenticationLinkModel
Code IndexAdd Codota to your IDE (free)

How to use
AuthenticationLinkModel
in
org.keycloak.models

Best Java code snippets using org.keycloak.models.AuthenticationLinkModel (Showing top 4 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
SimpleDateFormat s =
  • Codota IconString pattern;new SimpleDateFormat(pattern)
  • Codota IconString template;Locale locale;new SimpleDateFormat(template, locale)
  • Codota Iconnew SimpleDateFormat()
  • Smart code suggestions by Codota
}
origin: org.keycloak/keycloak-authentication-api

  private void checkCorrectAuthLink(AuthenticationProvider authProvider, AuthenticationProviderModel providerModel,
                   AuthenticationLinkModel authLinkModel, String username) throws AuthenticationProviderException {
    AuthUser authUser = authProvider.getUser(realm, providerModel.getConfig(), username);
    if (authUser == null) {
      throw new AuthenticationProviderException("User " + username + " not found in authentication provider " + providerModel.getProviderName());
    }
    String userExternalId = authUser.getId();
    if (!userExternalId.equals(authLinkModel.getAuthUserId())) {
      throw new AuthenticationProviderException("ID did not match! ID from provider: " + userExternalId + ", ID from authentication link: " + authLinkModel.getAuthUserId());
    }
  }
}
origin: org.keycloak/keycloak-authentication-api

public AuthProviderStatus validatePassword(UserModel user, String password) {
  AuthenticationLinkModel authLink = user.getAuthenticationLink();
  if (authLink == null) {
    // User not yet linked with any authenticationProvider. Find provider with biggest priority where he is and link
    AuthUser authUser = getUser(user.getLoginName());
    authLink = new AuthenticationLinkModel(authUser.getProviderName(), authUser.getId());
    user.setAuthenticationLink(authLink);
    logger.infof("User '%s' linked with provider '%s'", authUser.getUsername(), authUser.getProviderName());
  }
  String providerName = authLink.getAuthProvider();
  AuthenticationProviderModel providerModel = getConfiguredProviderModel(realm, providerName);
  AuthenticationProvider delegate = getProvider(providerName);
  if (delegate == null || providerModel == null) {
    return AuthProviderStatus.FAILED;
  }
  try {
    checkCorrectAuthLink(delegate, providerModel, authLink, user.getLoginName());
    AuthProviderStatus currentResult = delegate.validatePassword(realm, providerModel.getConfig(), user.getLoginName(), password);
    logger.debugf("Authentication provider '%s' finished with '%s' for authentication of '%s'", delegate.getName(), currentResult.toString(), user.getLoginName());
    return currentResult;
  } catch (AuthenticationProviderException ape) {
    logger.warn(ape.getMessage(), ape);
    return AuthProviderStatus.FAILED;
  }
}
origin: org.keycloak/keycloak-export-import-impl

AuthenticationLinkModel authLinkModel = new AuthenticationLinkModel();
this.propertiesManager.setBasicPropertiesToModel(authLinkModel, authLinkEntity);
origin: org.keycloak/keycloak-authentication-api

            authLink = new AuthenticationLinkModel(providerModel.getProviderName(), authUser.getId());
            user.setAuthenticationLink(authLink);
            logger.infof("User '%s' linked with provider '%s'", authUser.getUsername(), authUser.getProviderName());
          authLink = new AuthenticationLinkModel(providerModel.getProviderName(), userIdInProvider);
          user.setAuthenticationLink(authLink);
          logger.infof("User '%s' registered in provider '%s' and linked", user.getLoginName(), providerModel.getProviderName());
String providerName = authLink.getAuthProvider();
org.keycloak.modelsAuthenticationLinkModel

Most used methods

  • <init>
  • getAuthProvider
  • getAuthUserId

Popular in Java

  • Running tasks concurrently on multiple threads
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • setRequestProperty (URLConnection)
    Sets the general request property. If a property with the key already exists, overwrite its value wi
  • findViewById (Activity)
  • BufferedImage (java.awt.image)
    The BufferedImage subclass describes an java.awt.Image with an accessible buffer of image data. All
  • RandomAccessFile (java.io)
    Allows reading from and writing to a file in a random-access manner. This is different from the uni-
  • InetAddress (java.net)
    This class represents an Internet Protocol (IP) address. An IP address is either a 32-bit or 128-bit
  • BitSet (java.util)
    This class implements a vector of bits that grows as needed. Each component of the bit set has a boo
  • DataSource (javax.sql)
    A factory for connections to the physical data source that this DataSource object represents. An alt
  • XPath (javax.xml.xpath)
    XPath provides access to the XPath evaluation environment and expressions. Evaluation of XPath Expr
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now