Welcome Guest, Not a member yet? Register   Sign In
What's your favoite authentication/authorization library (or libraries)?
#1

[eluser]coding_hero[/eluser]
I'm trying to choose one, so I thought a poll might help.
#2

[eluser]Adam Griffiths[/eluser]
You may want to add The Auth Library to your list, I'm about to release a new version. Literally, 30 minutes. Smile
#3

[eluser]coding_hero[/eluser]
Ahh! I don't know if I can edit a poll. I don't see an option to do so.
#4

[eluser]Adam Griffiths[/eluser]
Lol no worries. I was just dropping a hint that my new auth library is coming, I'm just writing a quick tutorial on using it.
#5

[eluser]coding_hero[/eluser]
Excellent. I'll be sure to look at it.
#6

[eluser]garymardell[/eluser]
I actually prefer my home made library for auth. When creating systems i find its important to know the auth lib like the back of your hand, as you'll be wanting to extend it, strip it or whatever. It was easier to write my own than to try and learn someone else coding style and methods.
#7

[eluser]Adam Griffiths[/eluser]
@coding_hero @gazza (sorry I use twitter too much Tongue)

Take a look here - it's super simple, and you don't need to write any code to work with it, at all.
#8

[eluser]coding_hero[/eluser]
@Adam-
Looks great! I tried to implement it last night, and ran into some problems. I suspect I'm just not doing it right.

I basically have three controllers; 'user', 'admin' (I hope naming it 'admin' isn't causing some conflict), and 'login'; all three extend 'Application'. The 'login' controller is the default controller, so that the user is directed there straight off of the url. The 'login' controllers index calls $this->auth->login(). The 'user' controller determines what the end user can see, and the admin controller is the admin version of that same data. I figured I could just put $this->auth->restrict('admin') in the 'admin' constructor, and $this->auth->restrict('user') in the 'user' constructor. I planned to use another function in the 'login' controller that I called 'route' to route the user to the correct place upon login ($config['auth_login'] is currently set to 'login/route').

I can register a new user, and it tells me I am logged in and goes to 'login/route', but it does not go there upon login. Instead, it just stays at the login form.

So, here's my questions:
(1) What files are required for this to work? I have copied these into my install:
config/Auth.php
language/english/auth_lang.php
libraries/Auth.php
libraries/MY_Controller.php
views/auth/login.php
views/auth/reg_success.php
views/auth/register.php
views/auth/logout.php

Is 'controllers/admin.php' required for this library to work? I didn't copy it because I already had a controller named that, it it looked like sample code mostly.

(2) How do I get the login screen to redirect me to whatever is set in $config['auth_login'] upon successful login? Should it work this way automatically?

(3) If a user needs to change their password, is there a function I can call to do this (or a function I could submit the form to)?


If it sounds like I'm doing everything right, I just may need to do some debugging. I just wanted to run it past you to make sure I'm not doing something screwy.

Thanks for your help, and the sooner you could get back with me, the better. I'm on a tight deadline, and this is the last thing I have left before I'm done (I've missed a couple nights of sleep this week, because the client wanted to see it early).

Thanks for your help, and for what looks like a great library!
#9

[eluser]Adam Griffiths[/eluser]
You would be right in thinking that the admin.php controller isn't required, it's all example code.
The login function should work that way automatically, not sure why it isn't. In the meantime you can set the redirect URI by doing this:-

Code:
$this->auth->login('login/route');

There isn't a function that will change the users password, I'll add this to my to-do list and release it for 1.0.3.

If you check out the The Authentication Library User Guide, there's full documentation of everything and a link to the latest download.

Thanks,
Adam.
#10

[eluser]coding_hero[/eluser]
Thanks for the speedy reply! I'll keep debugging, and see what I come up with.




Theme © iAndrew 2016 - Forum software by © MyBB