Configure beforeOAuthRegister event handler to prevent registration from completing

Hi All,

We would like to dynamically allow/deny which users can register using an oAuth provider.

We have successfully configured oAuth and users are added to the Users table as they log in.

We have created a beforeOAuthRegister event handler that returns {‘short’: true} as per the documentation. See below.

Unfortunately the user gets registered anyway.

We need help to configure the oAuth registration flow to prevent users from being registered.

As a workaround we could accept users being disabled immediately after they are registered, if that would prevent them from accessing any application resource.

Thanks
Mario

Hi @Mario_Benuzzi1,

We’ll investigate the issue why the user gets registered anyway and let you know as soon as possible.

Regards,
Olha

Hello, is there any update?

Hello Mario, we have created an internal ticket to investigate the issue (BKNDLSS-32209), we’ll let you know when we have any results.

Regards,
Stanislaw

The documentation misled you (we’ll change it).

Premature result – is the result which will be returned instead of the original call and it must be in the same form as the result of original method.

But if you want to interrupt the invocation process – just throw an exception (BackendlessException), where you can write custom error message.