codeborne / mobileid

Java Mobile-ID interface for Estonia/Lithuania
http://codeborne.com/
MIT License
21 stars 9 forks source link

NullPointerException, if call "startLogin" method #8

Closed igorbljahhin closed 6 years ago

igorbljahhin commented 6 years ago

The method com.codeborne.security.mobileid.MobileIDAuthenticator#startLogin(java.lang.String, java.lang.String) is always failing with NPE:

Caused by: java.lang.NullPointerException: null
    at com.codeborne.security.mobileid.MobileIDAuthenticator.startLogin(MobileIDAuthenticator.java:122) ~[mobileid-1.1.jar:na]
    at com.codeborne.security.mobileid.MobileIDAuthenticator.startLogin(MobileIDAuthenticator.java:103) ~[mobileid-1.1.jar:na]
asolntsev commented 6 years ago

@igorbljahhin Wow. Thank you for reporting. I will take a look.

asolntsev commented 6 years ago

@igorbljahhin As I see from code, it can only happen if you pass null phone number to method MobileIDAuthenticator.startLogin(). So it's a bug in your code, right?

igorbljahhin commented 6 years ago

No, the method com.codeborne.security.mobileid.MobileIDAuthenticator#startLogin(java.lang.String, java.lang.String, java.lang.String) is protected, I can't call it. I call com.codeborne.security.mobileid.MobileIDAuthenticator#startLogin(java.lang.String, java.lang.String):

image

asolntsev commented 6 years ago

Why you need to call method startLogin(String personalCode, String countryCode) without phone number? Is it really a valid way to use MobleID? Probably we just need to delete this method?

igorbljahhin commented 6 years ago

Our task was to implemented login procedure using MobilID by personal identification ID. That's why I tried to use this method. But now, after looking around at other sites, I guess, you are right, phone number should be mandatory, but personal identification ID should be optional.

asolntsev commented 6 years ago

The fix has been released as version 1.2: http://search.maven.org/#search%7Cga%7C1%7Cmobileid