Appboy / appboy-android-sdk

Public repo for the Braze Android SDK
https://www.braze.com
Other
153 stars 102 forks source link

[Bug]: Not possible to set authentication signature if user is cached. #231

Closed NeriusZar closed 2 years ago

NeriusZar commented 2 years ago

Braze Android SDK Version

22.0.0

Steps To Reproduce

  1. Turn on SDK Authentication as Required in the dashboard.
  2. Use Braze.getInstance(context).changeUser(userId) function.
  3. Then use Braze.getInstance(context).changeUser(userId, sdkAuthSignature) or Braze.getInstance(context).setSdkAuthenticationSignature(signature).

Expected Behavior

Expected that signature is set and no more authentication errors appear.

Actual Incorrect Behavior

Receiving authentification errors with code - 26.

Verbose Logs

2022-08-10 15:04:16.886 I/Braze v22.0.0 .Braze: Received request to change current user 3f775bea-e1c1-4cf1-bcb7-06b118f3d8b7 to the same user id. Not changing user.
2022-08-10 15:04:19.659 I/Braze v22.0.0 .p: Completed the openSession call. Starting or continuing session 7e721546-1df5-4670-82e3-ea3e0bbdf944
2022-08-10 15:04:25.541 W/Braze v22.0.0 .s: Received server error from request: sdk_auth_error
2022-08-10 15:04:25.542 W/Braze v22.0.0 .g0: Error occurred while executing Braze request: sdk_auth_error
2022-08-10 15:04:35.337 W/Braze v22.0.0 .s: Received server error from request: sdk_auth_error
2022-08-10 15:04:35.338 W/Braze v22.0.0 .g0: Error occurred while executing Braze request: sdk_auth_error
... 
auth errors keep repeating

Additional Information

Works well when Braze.getInstance(context).changeUser(userId, sdkAuthSignature)` is used right away.

radixdev commented 2 years ago

Can you also provide verbose level logging of the issue? Starting from the full start of the application.

NeriusZar commented 2 years ago

I'm sorry, it seems that setIsSdkAuthenticationEnabled used to stay disabled because of our internal cache of configuration and that's why tokens were not used.