SOLVED: Authenticator.js decoding request / Error in auth callback...

A new … Help! I’m updating my node app (SAFE Drive) from safe-node-app 0.8.1 to 0.10.x

I’ve simplified the auth genAuthUri() parameters to match the example in the docs (except I have options = {own_container: false} and the Auth URI I created matches the one shown in the debug output, but Authenticate.js is complaining about something here:

16:10:41:232 Authenticator.js decoding request safe-auth:bAAAAAAARHAB3AAAAAAABAAAAAAAAAAAAONQWMZLOMV2HO33SNMWWM5LTMUABCAAAAAAAAAAAKNAUMRJAJZSXI53POJVSARSVKNCQWAAAAAAAAAAAORUGKV3FMJQWY6LTOQAAEAAAAAAAAAAAA4AAAAAAAAAAAX3QOVRGY2LDAQAAAAAAAAAAAAAAAAAACAAAAABAAAAAAMAAAAAMAAAAAAAAAAAF64DVMJWGSY2OMFWWK4YEAAAAAAAAAAAAAAAAAAAQAAAAAIAAAAADAAAAAAA
16:10:41:233 Error in auth callback. { 'ref.buffer': <Buffer@0xb16631b9c70 30 ff ff ff 00 00 00 00 60 93 e0 81 55 03 00 00> }

I’ve checked the parameters passed to genAuthUri() several times, so pretty sure they are ok. What else could cause the above error?

I see the error is in SAFE Browser, which looks like the failure is inside this.safeLib.auth_decode_ipc_msg(), which fails in one of its callbacks here:

2 Likes

I’m working on outputting a proper return.
I’m guessing this error is:

{ 
    description: 'IPC error: IncompatibleMockStatus',
    error_code: -208 
}

Most likely you are working with mock-routing and expecting your auth request to be generated for mock routing, which requires a mock bit, but are actually generating a request for live network.

Either the application needs to be executed with NODE_ENV=test environment variable, or forceUseMock: true passed to initialisation options, or app executed with --mock flag.

I confused myself over this yesterday actually. Going to review to make sure this is clear in documentation.

2 Likes

Thanks Hunter, I hadn’t noticed the change from NODE_ENV=dev to NODE_ENV=test, using the latter now works although I am not getting much further!

I now get to handling the auth response in my app, but then exit. I need to look into that though.

I have noticed something else, which might be intentional or a bug. I am using SB 11.1 (just released) and if I have the authenticator padlock open (ie automatically authorise apps) I never get the auth popup even if I have revoked auth. Is that expected (e.g. with dev build of browser --debug)?

I do get the popup with the authenticator padlock closed.

UPDATE: Sorted! I missed the change from fromAuthURI() to fromAuthUri().

Thanks for the fast responses @hunterlester , they are really appreciated.

1 Like

We’ve got to clean it up.

NODE_ENV=dev is for downloading both the mock and non-mock libs but mock libs won’t be used unless one of the three aforementioned options is used to actually load them.

Bug :bug:

2 Likes

Issue filed:

1 Like

This topic was automatically closed after 60 days. New replies are no longer allowed.