Package com.codeborne.security

Examples of com.codeborne.security.AuthenticationException


              messagingMode, 0, false, false, sessCode, result,
              personalCodeHolder, firstName, lastName, new StringHolder(), new StringHolder(), new StringHolder(), challenge,
              new StringHolder(), new StringHolder());
    }
    catch (RemoteException e) {
      throw new AuthenticationException(e);
    }

    if (!"OK".equals(result.value))
      throw new AuthenticationException(valueOf(result.value));

    return new MobileIDSession(sessCode.value, challenge.value, firstName.value, lastName.value, personalCodeHolder.value);
  }
View Full Code Here


    int tryCount = 0;
    while (sleep(pollIntervalMs) && !isLoginComplete(session) && tryCount < retryCount) {
        tryCount++;
    }
    if (tryCount >= retryCount)
      throw new AuthenticationException(valueOf(getLoginStatus(session).value));
    return session;
  }
View Full Code Here

    if ("OUTSTANDING_TRANSACTION".equals(status.value))
      return false;
    else if ("USER_AUTHENTICATED".equals(status.value))
      return true;
    else
      throw new AuthenticationException(valueOf(status.value));
  }
View Full Code Here

    StringHolder status = new StringHolder("OUTSTANDING_TRANSACTION");
    try {
      service.getMobileAuthenticateStatus(session.sessCode, false, status, new StringHolder());
    }
    catch (RemoteException e) {
      throw new AuthenticationException(e);
    }
    return status;
  }
View Full Code Here

  }

  @Override
  protected MobileIDSession startLogin(String personalCode, String countryCode, String phone) {
    if (phone == null || phone.length() < 5) {
      throw new AuthenticationException(AuthenticationException.Code.INVALID_INPUT, "Invalid PhoneNo", null);
    }
    else if (phone.startsWith("+372 phone-without-agreement")) {
      throw new AuthenticationException(AuthenticationException.Code.NO_AGREEMENT, "User is not a Mobile-ID client", null);
    }
    return new MobileIDSession(parseInt(phone.replaceFirst("\\+372(.*)", "$1")), "1234", firstName, lastName, personalCode == null ? this.personalCode : personalCode);
  }
View Full Code Here

  @Override
  public MobileIDSession waitForLogin(MobileIDSession session) {
    String phone = "+372" + session.sessCode;
    if (phone.startsWith("+372666")) {
      throw new AuthenticationException(AuthenticationException.Code.USER_CANCEL);
    }
    try {
      Thread.sleep(loginTimeMs);
    } catch (InterruptedException ignore) {
    }
View Full Code Here

      digiDocServicePortType.mobileAuthenticate(personalCode, countryCode, phone, language, serviceName, loginMessage, generateSPChallenge(),
          messagingMode, 0, false, false, sessCode, result,
          personalCodeHolder, firstName, lastName, new StringHolder(), new StringHolder(), new StringHolder(), challenge,
          new StringHolder(), new StringHolder());
    } catch (RemoteException e) {
      throw new AuthenticationException(e);
    }

    if (!"OK".equals(result.value))
      throw new AuthenticationException(valueOf(result.value));

    return new MobileIDSession(sessCode.value, challenge.value, firstName.value, lastName.value, personalCodeHolder.value);
  }
View Full Code Here

    int tryCount = 0;
    while (sleep(pollIntervalMs) && "OUTSTANDING_TRANSACTION".equals(status.value) && tryCount < retryCount) {
      try {
        digiDocServicePortType.getMobileAuthenticateStatus(session.sessCode, false, status, new StringHolder());
      } catch (RemoteException e) {
        throw new AuthenticationException(e);
      }
      tryCount++;
    }

    if (!"USER_AUTHENTICATED".equals(status.value))
      throw new AuthenticationException(valueOf(status.value));

    return session;
  }
View Full Code Here

          messagingMode, 0, false, false, sessCode, result,
          personalCodeHolder, firstName, lastName, new StringHolder(), new StringHolder(), new StringHolder(), challenge,
          new StringHolder(), new StringHolder());
    }
    catch (RemoteException e) {
      throw new AuthenticationException(e);
    }

    if (!"OK".equals(result.value))
      throw new AuthenticationException(valueOf(result.value));

    return new MobileIDSession(sessCode.value, challenge.value, firstName.value, lastName.value, personalCodeHolder.value);
  }
View Full Code Here

    while (sleep(pollIntervalMs) && "OUTSTANDING_TRANSACTION".equals(status.value) && tryCount < retryCount) {
      try {
        digiDocServicePortType.getMobileAuthenticateStatus(session.sessCode, false, status, new StringHolder());
      }
      catch (RemoteException e) {
        throw new AuthenticationException(e);
      }
      tryCount++;
    }

    if (!"USER_AUTHENTICATED".equals(status.value))
      throw new AuthenticationException(valueOf(status.value));

    return session;
  }
View Full Code Here

TOP

Related Classes of com.codeborne.security.AuthenticationException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.