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


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

    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

  }

  @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("+37255")) {
      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("+37256")) {
      throw new AuthenticationException(AuthenticationException.Code.USER_CANCEL);
    }
    try {
      Thread.sleep(loginTimeMs);
    } catch (InterruptedException ignore) {
    }
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.