K
K
Kirill Gorelov2018-06-01 15:21:34
1C-Bitrix
Kirill Gorelov, 2018-06-01 15:21:34

Bitrix, saved authorization check failed?

Guys, problem.
We write api on Bitrix for a mobile application (MP). And it is necessary that the user can log in and register through mp. And registration should also go through social networks.
In order for the user to log in, we give him a token of the form: (id_user:hach_password). And for a user who registers through a social network, we indicate through which network he logged in. (VK or FB), there is a standard EXTERNAL_AUTH_ID variable in Bitrix.
After the registration has passed, he receives his token and wants to log in with it. And at this moment, at the moment of authorization, an error pops up from Bitrix. "Saved authorization check failed." And that's it, here we have a plug ((
If the user logs in via mail, everything works for him.
Token is generated in this way. $ID_USER . ':' . $USER->GetSessionHash();
We check the user for authorization in this way: $USER->LoginByHash($ID_LOGIN, $hash);
Accordingly, putting everything in its place. The user finds, but does not authorize.
Already checked all the sources, all alas.
We looked at these functions in more detail, so that it would be clear at what stage we have a problem, but it is still not very clear what is wrong.
bxapi.ru/src/?module_id=main&name=CUser%3A%3AAuthorize
bxapi.ru/src/?module_id=main&name=CUser::UpdateSes...
bxapi.ru/src/?module_id=main&name=CUser%3A%3ALogin ...
bxapi.ru/src/?module_id=main&name=CUser%3A%3ACheck...
I understand that without code it will be difficult, but everyone who can come across a similar situation, I will be glad for any advice)

Answer the question

In order to leave comments, you need to log in

1 answer(s)
K
Kirill Gorelov, 2018-06-09
@Kirill-Gorelov

If suddenly someone then come in handy.
The issue was resolved.
As I wrote, this error occurred for users from social networks.
The matter is that session authorization of users to be stored in a DB. And for users from social networks, this was not saved, it is so configured by Bitrix. We just disabled checking for a user from the social network.
This is done in the Cuser class. I don't remember the exact method. But you need to look at the
loginbyhash and authorize methods

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question