line-sdk-android icon indicating copy to clipboard operation
line-sdk-android copied to clipboard

LineApiError{httpResponseCode=-1, message='Illegal parameter value of 'state'.', errorCode='NOT_DEFINED'

Open janroid opened this issue 3 years ago • 1 comments

Is it a security issue?

Not

What did you do?

Use the LINE SDK For Android,Test login, showing error:LineApiError{httpResponseCode=-1, message='Illegal parameter value of 'state'.', errorCode='NOT_DEFINED'

Your environment?

Line Android SDK v5.7.0 Android targetSdkVersion = 30 Android minSdkVersion = 19 Device : vivo 1904(Android 11)

Sample project

I can show my CODE:

public void login(int callbackId, String param) { mCallBackKey = callbackId; setListener();

    try {
        Intent loginIntent = LineLoginApi.getLoginIntent(mContext, mChannelID,new LineAuthenticationParams.Builder()
                .scopes(Arrays.asList(Scope.PROFILE))
                // .nonce("<a randomly-generated string>") // nonce can be used to improve security
                .build());
        ((Activity)mContext).startActivityForResult(loginIntent, REQUEST_CODE);
    } catch (Exception e) {
        Log.e("ERROR", e.toString());
    }

}

public void onLoginResult(Intent data) { LineLoginResult result = LineLoginApi.getLoginResultFromIntent(data);

    JSONObject jsonObj = new JSONObject();
    try {
        LineApiResponseCode resCode = result.getResponseCode();
        switch (resCode) {
            case SUCCESS:
                // Login successful
                break;

            case CANCEL:
                // Login canceled by user
                break;

            default:
                // Login canceled due to other error
                String msg = result.getErrorData().toString();
                Log.e("Line Auth ERROR", result.getErrorData().toString());
        }
    } catch (JSONException e) {
        e.printStackTrace();
    }

}

janroid avatar Nov 17 '21 07:11 janroid

Hi, @janroid Could you provide a sample project that can reproduce the error? According to your code snippet, it looks fine to me.

plateaukao avatar Apr 15 '22 09:04 plateaukao

close due to no further information provided

plateaukao avatar Jan 10 '23 11:01 plateaukao