Program: 9064
Project: 9064
Buggy source:
public int process(Callback[] callbacks,int state) throws LoginException {
  OAuthUtil.debugMessage("String_Node_Str" + state);
  HttpServletRequest request=getHttpServletRequest();
  HttpServletResponse response=getHttpServletResponse();
  if (request == null) {
    OAuthUtil.debugError("String_Node_Str" + "String_Node_Str");
    return ISAuthConstants.LOGIN_IGNORE;
  }
  String code=request.getParameter(PARAM_CODE);
  if (code != null) {
    OAuthUtil.debugMessage("String_Node_Str" + code);
    state=GET_OAUTH_TOKEN_STATE;
  }
  proxyURL=config.getProxyURL();
switch (state) {
case ISAuthConstants.LOGIN_START:
{
      config.validateConfiguration();
      serverName=request.getServerName();
      StringBuilder originalUrl=new StringBuilder();
      String requestedQuery=request.getQueryString();
      String realm=null;
      String authCookieName=AuthUtils.getAuthCookieName();
      final XUIState xuiState=InjectorHolder.getInstance(XUIState.class);
      if (xuiState.isXUIEnabled()) {
        originalUrl.append(request.getContextPath());
        if (requestedQuery != null && !requestedQuery.contains("String_Node_Str")) {
          realm=request.getParameter("String_Node_Str");
        }
      }
 else {
        originalUrl.append(request.getRequestURI());
      }
      if (StringUtils.isNotEmpty(realm)) {
        originalUrl.append("String_Node_Str").append(URLEncDec.encode(realm));
      }
      if (requestedQuery != null) {
        if (requestedQuery.endsWith(authCookieName + "String_Node_Str")) {
          requestedQuery=requestedQuery.substring(0,requestedQuery.length() - authCookieName.length() - 1);
        }
        originalUrl.append(originalUrl.indexOf("String_Node_Str") == -1 ? '?' : '&');
        originalUrl.append(requestedQuery);
      }
      Set<String> domains=AuthClientUtils.getCookieDomains();
      String ProviderLogoutURL=config.getLogoutServiceUrl();
      String csrfStateTokenId=RandomStringUtils.randomAlphanumeric(32);
      String csrfState=createAuthorizationState();
      Token csrfStateToken=new Token(csrfStateTokenId,TokenType.GENERIC);
      csrfStateToken.setAttribute(CoreTokenField.STRING_ONE,csrfState);
      csrfStateToken.setAttribute(CoreTokenField.STRING_TWO,getCodeVerifier(config.getCodeChallengeMethod()));
      try {
        ctsStore.create(csrfStateToken);
      }
 catch (      CoreTokenException e) {
        OAuthUtil.debugError("String_Node_Str" + "String_Node_Str");
        throw new AuthLoginException("String_Node_Str" + "String_Node_Str",e);
      }
      for (      String domain : domains) {
        CookieUtils.addCookieToResponse(response,CookieUtils.newCookie(COOKIE_PROXY_URL,proxyURL,"String_Node_Str",domain));
        CookieUtils.addCookieToResponse(response,CookieUtils.newCookie(COOKIE_ORIG_URL,originalUrl.toString(),"String_Node_Str",domain));
        CookieUtils.addCookieToResponse(response,CookieUtils.newCookie(NONCE_TOKEN_ID,csrfStateTokenId,"String_Node_Str",domain));
        if (ProviderLogoutURL != null && !ProviderLogoutURL.isEmpty()) {
          CookieUtils.addCookieToResponse(response,CookieUtils.newCookie(COOKIE_LOGOUT_URL,ProviderLogoutURL,"String_Node_Str",domain));
        }
      }
      setUserSessionProperty(ISAuthConstants.FULL_LOGIN_URL,originalUrl.toString());
      setUserSessionProperty(SESSION_LOGOUT_BEHAVIOUR,config.getLogoutBhaviour());
      String authServiceUrl=config.getAuthServiceUrl(proxyURL,csrfState,getCodeVerifier(config.getCodeChallengeMethod()),config.getCodeChallengeMethod());
      OAuthUtil.debugMessage("String_Node_Str" + authServiceUrl);
      Callback[] callbacks1=getCallback(2);
      RedirectCallback rc=(RedirectCallback)callbacks1[0];
      RedirectCallback rcNew=new RedirectCallback(authServiceUrl,null,"String_Node_Str",rc.getStatusParameter(),rc.getRedirectBackUrlCookieName());
      replaceCallback(2,0,rcNew);
      return GET_OAUTH_TOKEN_STATE;
    }
case GET_OAUTH_TOKEN_STATE:
{
    final String csrfState;
    if (request.getParameter("String_Node_Str") != null) {
      final JsonValue jval=JsonValueBuilder.toJsonValue(request.getParameter("String_Node_Str"));
      csrfState=jval.get("String_Node_Str").asString();
      code=jval.get(PARAM_CODE).asString();
    }
 else {
      csrfState=request.getParameter("String_Node_Str");
      code=request.getParameter(PARAM_CODE);
    }
    if (csrfState == null) {
      OAuthUtil.debugError("String_Node_Str" + "String_Node_Str");
      throw new AuthLoginException(BUNDLE_NAME,"String_Node_Str",null);
    }
    try {
      Token csrfStateToken=ctsStore.read(OAuthUtil.findCookie(request,NONCE_TOKEN_ID));
      ctsStore.deleteAsync(csrfStateToken);
      String expectedCsrfState=csrfStateToken.getValue(CoreTokenField.STRING_ONE);
      if (!expectedCsrfState.equals(csrfState)) {
        OAuthUtil.debugError("String_Node_Str" + "String_Node_Str");
        throw new AuthLoginException(BUNDLE_NAME,"String_Node_Str",null);
      }
      if (code == null || code.isEmpty()) {
        OAuthUtil.debugMessage("String_Node_Str");
        return ISAuthConstants.LOGIN_START;
      }
      validateInput("String_Node_Str",code,"String_Node_Str",512,false);
      OAuthUtil.debugMessage("String_Node_Str" + code);
      final String codeVerifier=csrfStateToken.getValue(CoreTokenField.STRING_TWO);
      String tokenSvcResponse=getContent(config.getTokenServiceUrl(code,proxyURL,codeVerifier),null);
      OAuthUtil.debugMessage("String_Node_Str" + tokenSvcResponse);
      JwtClaimsSet jwtClaims=null;
      String idToken=null;
      if (config.isOpenIDConnect()) {
        idToken=extractToken(ID_TOKEN,tokenSvcResponse);
        JwtHandler jwtHandler=new JwtHandler(jwtHandlerConfig);
        try {
          jwtClaims=jwtHandler.validateJwt(idToken);
        }
 catch (        RuntimeException|AuthLoginException e) {
          debug.warning("String_Node_Str",e);
          throw e;
        }
        if (!JwtHandler.isIntendedForAudience(config.getClientId(),jwtClaims)) {
          OAuthUtil.debugError("String_Node_Str");
          throw new AuthLoginException(BUNDLE_NAME,"String_Node_Str",null);
        }
      }
      String token=extractToken(PARAM_ACCESS_TOKEN,tokenSvcResponse);
      setUserSessionProperty(SESSION_OAUTH_TOKEN,token);
      String profileSvcResponse=null;
      if (StringUtils.isNotEmpty(config.getProfileServiceUrl())) {
        profileSvcResponse=getContent(config.getProfileServiceUrl(),"String_Node_Str" + token);
        OAuthUtil.debugMessage("String_Node_Str" + profileSvcResponse);
      }
      String realm=getRequestOrg();
      if (realm == null) {
        realm="String_Node_Str";
      }
      AccountProvider accountProvider=instantiateAccountProvider();
      AttributeMapper accountAttributeMapper=instantiateAccountMapper();
      Map<String,Set<String>> userNames=getAttributes(profileSvcResponse,config.getAccountMapperConfig(),accountAttributeMapper,jwtClaims);
      String user=null;
      if (!userNames.isEmpty()) {
        user=getUser(realm,accountProvider,userNames);
      }
      if (user == null && !config.getCreateAccountFlag()) {
        authenticatedUser=getDynamicUser(userNames);
        if (authenticatedUser != null) {
          if (config.getSaveAttributesToSessionFlag()) {
            Map<String,Set<String>> attributes=getAttributesMap(profileSvcResponse,jwtClaims);
            saveAttributes(attributes);
          }
          OAuthUtil.debugMessage("String_Node_Str" + "String_Node_Str" + authenticatedUser);
          storeUsernamePasswd(authenticatedUser,null);
          return ISAuthConstants.LOGIN_SUCCEED;
        }
 else {
          throw new AuthLoginException("String_Node_Str");
        }
      }
      if (user == null && config.getCreateAccountFlag()) {
        if (config.getPromptPasswordFlag()) {
          setUserSessionProperty(PROFILE_SERVICE_RESPONSE,profileSvcResponse);
          if (config.isOpenIDConnect()) {
            setUserSessionProperty(OPENID_TOKEN,idToken);
          }
          return SET_PASSWORD_STATE;
        }
 else {
          authenticatedUser=provisionAccountNow(accountProvider,realm,profileSvcResponse,getRandomData(),jwtClaims);
          if (authenticatedUser != null) {
            OAuthUtil.debugMessage("String_Node_Str" + authenticatedUser);
            storeUsernamePasswd(authenticatedUser,null);
            return ISAuthConstants.LOGIN_SUCCEED;
          }
 else {
            return ISAuthConstants.LOGIN_IGNORE;
          }
        }
      }
      if (user != null) {
        authenticatedUser=user;
        OAuthUtil.debugMessage("String_Node_Str" + "String_Node_Str" + authenticatedUser);
        if (config.getSaveAttributesToSessionFlag()) {
          Map<String,Set<String>> attributes=getAttributesMap(profileSvcResponse,jwtClaims);
          saveAttributes(attributes);
        }
        storeUsernamePasswd(authenticatedUser,null);
        return ISAuthConstants.LOGIN_SUCCEED;
      }
    }
 catch (    JSONException je) {
      OAuthUtil.debugError("String_Node_Str" + je.getMessage());
      throw new AuthLoginException(BUNDLE_NAME,"String_Node_Str",null,je);
    }
catch (    SSOException ssoe) {
      OAuthUtil.debugError("String_Node_Str" + ssoe.getMessage());
      throw new AuthLoginException(BUNDLE_NAME,"String_Node_Str",null,ssoe);
    }
catch (    IdRepoException ire) {
      OAuthUtil.debugError("String_Node_Str" + ire.getMessage());
      throw new AuthLoginException(BUNDLE_NAME,"String_Node_Str",null,ire);
    }
catch (    CoreTokenException e) {
      OAuthUtil.debugError("String_Node_Str" + "String_Node_Str");
      throw new AuthLoginException(BUNDLE_NAME,"String_Node_Str",null,e);
    }
    break;
  }
case SET_PASSWORD_STATE:
{
  if (!config.getCreateAccountFlag()) {
    return ISAuthConstants.LOGIN_IGNORE;
  }
  userPassword=request.getParameter(PARAM_TOKEN1);
  validateInput(PARAM_TOKEN1,userPassword,"String_Node_Str",512,false);
  String userPassword2=request.getParameter(PARAM_TOKEN2);
  validateInput(PARAM_TOKEN2,userPassword2,"String_Node_Str",512,false);
  if (!userPassword.equals(userPassword2)) {
    OAuthUtil.debugWarning("String_Node_Str");
    return SET_PASSWORD_STATE;
  }
  String terms=request.getParameter("String_Node_Str");
  if (!terms.equalsIgnoreCase("String_Node_Str")) {
    return SET_PASSWORD_STATE;
  }
  String profileSvcResponse=getUserSessionProperty("String_Node_Str");
  data=getRandomData();
  String mail=getMail(profileSvcResponse,config.getMailAttribute());
  OAuthUtil.debugMessage("String_Node_Str" + mail);
  try {
    OAuthUtil.sendEmail(config.getEmailFrom(),mail,data,config.getSMTPConfig(),bundle,proxyURL);
  }
 catch (  NoEmailSentException ex) {
    OAuthUtil.debugError("String_Node_Str",ex);
    throw new AuthLoginException("String_Node_Str" + "String_Node_Str");
  }
  OAuthUtil.debugMessage("String_Node_Str" + data);
  return CREATE_USER_STATE;
}
case CREATE_USER_STATE:
{
String activation=request.getParameter(PARAM_ACTIVATION);
validateInput(PARAM_ACTIVATION,activation,"String_Node_Str",512,false);
OAuthUtil.debugMessage("String_Node_Str" + activation);
if (activation == null || activation.isEmpty() || !activation.trim().equals(data.trim())) {
  return CREATE_USER_STATE;
}
String profileSvcResponse=getUserSessionProperty(PROFILE_SERVICE_RESPONSE);
String idToken=getUserSessionProperty(ID_TOKEN);
String realm=getRequestOrg();
if (realm == null) {
  realm="String_Node_Str";
}
OAuthUtil.debugMessage("String_Node_Str" + profileSvcResponse);
AccountProvider accountProvider=instantiateAccountProvider();
JwtClaimsSet jwtClaims=null;
if (idToken != null) {
  jwtClaims=new JwtHandler(jwtHandlerConfig).getJwtClaims(idToken);
}
authenticatedUser=provisionAccountNow(accountProvider,realm,profileSvcResponse,userPassword,jwtClaims);
if (authenticatedUser != null) {
  OAuthUtil.debugMessage("String_Node_Str" + authenticatedUser);
  storeUsernamePasswd(authenticatedUser,null);
  return ISAuthConstants.LOGIN_SUCCEED;
}
 else {
  return ISAuthConstants.LOGIN_IGNORE;
}
}
default :
{
OAuthUtil.debugError("String_Node_Str");
return ISAuthConstants.LOGIN_IGNORE;
}
}
throw new AuthLoginException(BUNDLE_NAME,"String_Node_Str",null);
}

Fixed version (ground truth):
public int process(Callback[] callbacks,int state) throws LoginException {
  OAuthUtil.debugMessage("String_Node_Str" + state);
  HttpServletRequest request=getHttpServletRequest();
  HttpServletResponse response=getHttpServletResponse();
  if (request == null) {
    OAuthUtil.debugError("String_Node_Str" + "String_Node_Str");
    return ISAuthConstants.LOGIN_IGNORE;
  }
  String code=request.getParameter(PARAM_CODE);
  if (code != null) {
    OAuthUtil.debugMessage("String_Node_Str" + code);
    state=GET_OAUTH_TOKEN_STATE;
  }
  proxyURL=config.getProxyURL();
switch (state) {
case ISAuthConstants.LOGIN_START:
{
      config.validateConfiguration();
      serverName=request.getServerName();
      StringBuilder originalUrl=new StringBuilder();
      String requestedQuery=request.getQueryString();
      String realm=null;
      String authCookieName=AuthUtils.getAuthCookieName();
      final XUIState xuiState=InjectorHolder.getInstance(XUIState.class);
      if (xuiState.isXUIEnabled()) {
        originalUrl.append(request.getContextPath());
        if (requestedQuery != null && !requestedQuery.contains("String_Node_Str")) {
          realm=request.getParameter("String_Node_Str");
        }
      }
 else {
        originalUrl.append(request.getRequestURI());
      }
      if (StringUtils.isNotEmpty(realm)) {
        originalUrl.append("String_Node_Str").append(URLEncDec.encode(realm));
      }
      if (requestedQuery != null) {
        if (requestedQuery.endsWith(authCookieName + "String_Node_Str")) {
          requestedQuery=requestedQuery.substring(0,requestedQuery.length() - authCookieName.length() - 1);
        }
        originalUrl.append(originalUrl.indexOf("String_Node_Str") == -1 ? '?' : '&');
        originalUrl.append(requestedQuery);
      }
      Set<String> domains=AuthClientUtils.getCookieDomains();
      String ProviderLogoutURL=config.getLogoutServiceUrl();
      String csrfStateTokenId=RandomStringUtils.randomAlphanumeric(32);
      String csrfState=createAuthorizationState();
      Token csrfStateToken=new Token(csrfStateTokenId,TokenType.GENERIC);
      csrfStateToken.setAttribute(CoreTokenField.STRING_ONE,csrfState);
      csrfStateToken.setAttribute(CoreTokenField.STRING_TWO,getCodeVerifier(config.getCodeChallengeMethod()));
      try {
        ctsStore.create(csrfStateToken);
      }
 catch (      CoreTokenException e) {
        OAuthUtil.debugError("String_Node_Str" + "String_Node_Str");
        throw new AuthLoginException("String_Node_Str" + "String_Node_Str",e);
      }
      for (      String domain : domains) {
        CookieUtils.addCookieToResponse(response,CookieUtils.newCookie(COOKIE_PROXY_URL,proxyURL,"String_Node_Str",domain));
        CookieUtils.addCookieToResponse(response,CookieUtils.newCookie(COOKIE_ORIG_URL,originalUrl.toString(),"String_Node_Str",domain));
        CookieUtils.addCookieToResponse(response,CookieUtils.newCookie(NONCE_TOKEN_ID,csrfStateTokenId,"String_Node_Str",domain));
        if (ProviderLogoutURL != null && !ProviderLogoutURL.isEmpty()) {
          CookieUtils.addCookieToResponse(response,CookieUtils.newCookie(COOKIE_LOGOUT_URL,ProviderLogoutURL,"String_Node_Str",domain));
        }
      }
      setUserSessionProperty(ISAuthConstants.FULL_LOGIN_URL,originalUrl.toString());
      setUserSessionProperty(SESSION_LOGOUT_BEHAVIOUR,config.getLogoutBhaviour());
      String authServiceUrl=config.getAuthServiceUrl(proxyURL,csrfState,getCodeVerifier(config.getCodeChallengeMethod()),config.getCodeChallengeMethod());
      OAuthUtil.debugMessage("String_Node_Str" + authServiceUrl);
      Callback[] callbacks1=getCallback(2);
      RedirectCallback rc=(RedirectCallback)callbacks1[0];
      RedirectCallback rcNew=new RedirectCallback(authServiceUrl,null,"String_Node_Str",rc.getStatusParameter(),rc.getRedirectBackUrlCookieName());
      rcNew.setTrackingCookie(true);
      replaceCallback(2,0,rcNew);
      return GET_OAUTH_TOKEN_STATE;
    }
case GET_OAUTH_TOKEN_STATE:
{
    final String csrfState;
    if (request.getParameter("String_Node_Str") != null) {
      final JsonValue jval=JsonValueBuilder.toJsonValue(request.getParameter("String_Node_Str"));
      csrfState=jval.get("String_Node_Str").asString();
      code=jval.get(PARAM_CODE).asString();
    }
 else {
      csrfState=request.getParameter("String_Node_Str");
      code=request.getParameter(PARAM_CODE);
    }
    if (csrfState == null) {
      OAuthUtil.debugError("String_Node_Str" + "String_Node_Str");
      throw new AuthLoginException(BUNDLE_NAME,"String_Node_Str",null);
    }
    try {
      Token csrfStateToken=ctsStore.read(OAuthUtil.findCookie(request,NONCE_TOKEN_ID));
      ctsStore.deleteAsync(csrfStateToken);
      String expectedCsrfState=csrfStateToken.getValue(CoreTokenField.STRING_ONE);
      if (!expectedCsrfState.equals(csrfState)) {
        OAuthUtil.debugError("String_Node_Str" + "String_Node_Str");
        throw new AuthLoginException(BUNDLE_NAME,"String_Node_Str",null);
      }
      if (code == null || code.isEmpty()) {
        OAuthUtil.debugMessage("String_Node_Str");
        return ISAuthConstants.LOGIN_START;
      }
      validateInput("String_Node_Str",code,"String_Node_Str",512,false);
      OAuthUtil.debugMessage("String_Node_Str" + code);
      final String codeVerifier=csrfStateToken.getValue(CoreTokenField.STRING_TWO);
      String tokenSvcResponse=getContent(config.getTokenServiceUrl(code,proxyURL,codeVerifier),null);
      OAuthUtil.debugMessage("String_Node_Str" + tokenSvcResponse);
      JwtClaimsSet jwtClaims=null;
      String idToken=null;
      if (config.isOpenIDConnect()) {
        idToken=extractToken(ID_TOKEN,tokenSvcResponse);
        JwtHandler jwtHandler=new JwtHandler(jwtHandlerConfig);
        try {
          jwtClaims=jwtHandler.validateJwt(idToken);
        }
 catch (        RuntimeException|AuthLoginException e) {
          debug.warning("String_Node_Str",e);
          throw e;
        }
        if (!JwtHandler.isIntendedForAudience(config.getClientId(),jwtClaims)) {
          OAuthUtil.debugError("String_Node_Str");
          throw new AuthLoginException(BUNDLE_NAME,"String_Node_Str",null);
        }
      }
      String token=extractToken(PARAM_ACCESS_TOKEN,tokenSvcResponse);
      setUserSessionProperty(SESSION_OAUTH_TOKEN,token);
      String profileSvcResponse=null;
      if (StringUtils.isNotEmpty(config.getProfileServiceUrl())) {
        profileSvcResponse=getContent(config.getProfileServiceUrl(),"String_Node_Str" + token);
        OAuthUtil.debugMessage("String_Node_Str" + profileSvcResponse);
      }
      String realm=getRequestOrg();
      if (realm == null) {
        realm="String_Node_Str";
      }
      AccountProvider accountProvider=instantiateAccountProvider();
      AttributeMapper accountAttributeMapper=instantiateAccountMapper();
      Map<String,Set<String>> userNames=getAttributes(profileSvcResponse,config.getAccountMapperConfig(),accountAttributeMapper,jwtClaims);
      String user=null;
      if (!userNames.isEmpty()) {
        user=getUser(realm,accountProvider,userNames);
      }
      if (user == null && !config.getCreateAccountFlag()) {
        authenticatedUser=getDynamicUser(userNames);
        if (authenticatedUser != null) {
          if (config.getSaveAttributesToSessionFlag()) {
            Map<String,Set<String>> attributes=getAttributesMap(profileSvcResponse,jwtClaims);
            saveAttributes(attributes);
          }
          OAuthUtil.debugMessage("String_Node_Str" + "String_Node_Str" + authenticatedUser);
          storeUsernamePasswd(authenticatedUser,null);
          return ISAuthConstants.LOGIN_SUCCEED;
        }
 else {
          throw new AuthLoginException("String_Node_Str");
        }
      }
      if (user == null && config.getCreateAccountFlag()) {
        if (config.getPromptPasswordFlag()) {
          setUserSessionProperty(PROFILE_SERVICE_RESPONSE,profileSvcResponse);
          if (config.isOpenIDConnect()) {
            setUserSessionProperty(OPENID_TOKEN,idToken);
          }
          return SET_PASSWORD_STATE;
        }
 else {
          authenticatedUser=provisionAccountNow(accountProvider,realm,profileSvcResponse,getRandomData(),jwtClaims);
          if (authenticatedUser != null) {
            OAuthUtil.debugMessage("String_Node_Str" + authenticatedUser);
            storeUsernamePasswd(authenticatedUser,null);
            return ISAuthConstants.LOGIN_SUCCEED;
          }
 else {
            return ISAuthConstants.LOGIN_IGNORE;
          }
        }
      }
      if (user != null) {
        authenticatedUser=user;
        OAuthUtil.debugMessage("String_Node_Str" + "String_Node_Str" + authenticatedUser);
        if (config.getSaveAttributesToSessionFlag()) {
          Map<String,Set<String>> attributes=getAttributesMap(profileSvcResponse,jwtClaims);
          saveAttributes(attributes);
        }
        storeUsernamePasswd(authenticatedUser,null);
        return ISAuthConstants.LOGIN_SUCCEED;
      }
    }
 catch (    JSONException je) {
      OAuthUtil.debugError("String_Node_Str" + je.getMessage());
      throw new AuthLoginException(BUNDLE_NAME,"String_Node_Str",null,je);
    }
catch (    SSOException ssoe) {
      OAuthUtil.debugError("String_Node_Str" + ssoe.getMessage());
      throw new AuthLoginException(BUNDLE_NAME,"String_Node_Str",null,ssoe);
    }
catch (    IdRepoException ire) {
      OAuthUtil.debugError("String_Node_Str" + ire.getMessage());
      throw new AuthLoginException(BUNDLE_NAME,"String_Node_Str",null,ire);
    }
catch (    CoreTokenException e) {
      OAuthUtil.debugError("String_Node_Str" + "String_Node_Str");
      throw new AuthLoginException(BUNDLE_NAME,"String_Node_Str",null,e);
    }
    break;
  }
case SET_PASSWORD_STATE:
{
  if (!config.getCreateAccountFlag()) {
    return ISAuthConstants.LOGIN_IGNORE;
  }
  userPassword=request.getParameter(PARAM_TOKEN1);
  validateInput(PARAM_TOKEN1,userPassword,"String_Node_Str",512,false);
  String userPassword2=request.getParameter(PARAM_TOKEN2);
  validateInput(PARAM_TOKEN2,userPassword2,"String_Node_Str",512,false);
  if (!userPassword.equals(userPassword2)) {
    OAuthUtil.debugWarning("String_Node_Str");
    return SET_PASSWORD_STATE;
  }
  String terms=request.getParameter("String_Node_Str");
  if (!terms.equalsIgnoreCase("String_Node_Str")) {
    return SET_PASSWORD_STATE;
  }
  String profileSvcResponse=getUserSessionProperty("String_Node_Str");
  data=getRandomData();
  String mail=getMail(profileSvcResponse,config.getMailAttribute());
  OAuthUtil.debugMessage("String_Node_Str" + mail);
  try {
    OAuthUtil.sendEmail(config.getEmailFrom(),mail,data,config.getSMTPConfig(),bundle,proxyURL);
  }
 catch (  NoEmailSentException ex) {
    OAuthUtil.debugError("String_Node_Str",ex);
    throw new AuthLoginException("String_Node_Str" + "String_Node_Str");
  }
  OAuthUtil.debugMessage("String_Node_Str" + data);
  return CREATE_USER_STATE;
}
case CREATE_USER_STATE:
{
String activation=request.getParameter(PARAM_ACTIVATION);
validateInput(PARAM_ACTIVATION,activation,"String_Node_Str",512,false);
OAuthUtil.debugMessage("String_Node_Str" + activation);
if (activation == null || activation.isEmpty() || !activation.trim().equals(data.trim())) {
  return CREATE_USER_STATE;
}
String profileSvcResponse=getUserSessionProperty(PROFILE_SERVICE_RESPONSE);
String idToken=getUserSessionProperty(ID_TOKEN);
String realm=getRequestOrg();
if (realm == null) {
  realm="String_Node_Str";
}
OAuthUtil.debugMessage("String_Node_Str" + profileSvcResponse);
AccountProvider accountProvider=instantiateAccountProvider();
JwtClaimsSet jwtClaims=null;
if (idToken != null) {
  jwtClaims=new JwtHandler(jwtHandlerConfig).getJwtClaims(idToken);
}
authenticatedUser=provisionAccountNow(accountProvider,realm,profileSvcResponse,userPassword,jwtClaims);
if (authenticatedUser != null) {
  OAuthUtil.debugMessage("String_Node_Str" + authenticatedUser);
  storeUsernamePasswd(authenticatedUser,null);
  return ISAuthConstants.LOGIN_SUCCEED;
}
 else {
  return ISAuthConstants.LOGIN_IGNORE;
}
}
default :
{
OAuthUtil.debugError("String_Node_Str");
return ISAuthConstants.LOGIN_IGNORE;
}
}
throw new AuthLoginException(BUNDLE_NAME,"String_Node_Str",null);
}