Welcome Guest, Not a member yet? Register   Sign In
Community Auth: Api alike login
#2

First, it seems that you are aware of the missing login token, and you will definitely need it to be able to login. I think you are perhaps misunderstanding the use of the tokens library. You should just consider the tokens the same as usage for CI CSRF tokens. I just happen to like the way mine works better.

Next, your usage of the tokens in your controller is flawed. The reason for this is that $CI->tokens->token() creates a new token, which you are applying to $_POST['login_token']. This will never work, because the freshly generated token will never match the one that was supposed to be generated and submitted for the login attempt. Also, in theory what you are trying to do is to circumnavigate proper token usage, which defeats the benefits of using them in the first place.

Next, if you want to return all of the user's data as a json object, that's just something that you would do with CI, and doesn't really have anything to do with CommunityAuth (unless you want this data available on every request). If you do want the data available on every request, you should read the blog post on the Community Auth website that addresses user profiles. It will give you some hints as to extending Community Auth to allow for customization of the auth data (and make profile data availiable).

So, check here first:
http://community-auth.com/blog-posts/int...r-profiles
Reply


Messages In This Thread
Community Auth: Api alike login - by enghell - 11-20-2015, 02:26 AM
RE: Community Auth: Api alike login - by skunkbad - 11-20-2015, 01:51 PM
RE: Community Auth: Api alike login - by enghell - 11-20-2015, 09:33 PM



Theme © iAndrew 2016 - Forum software by © MyBB