EllisLab text mark
Advanced Search
5 of 17
5
   
flexi auth - A user authentication library for CodeIgniter
Posted: 19 October 2012 07:56 PM   [ Ignore ]   [ # 71 ]   [ Rating: 0 ]
Joined: 2012-03-08
159 posts

@davidinchi

Yes you were right, there was a bug with the library and IE setting login cookies on the ‘Login via Ajax’ example.
Although I could only regenerate the bug in IE and not Chrome as you suggested.
However, I’m pretty sure the fix should address any browsers that were having the same issue.

You can get the fix from the usual Github repo.
The only file that needs to be updated is ‘flexi_auth_lite_model.php’.

@skunkbad

As said above, this particular issue would have been specific to the flexi-auth library rather than inherited from ion-auth.
Although the flexi-auth library was originally built on many of the foundations of ion-auth, by the time I released the library, the code base had virtually been completely rewritten.
So any bugs affecting ion-auth are unlikely to also affect flexi-auth.

 Signature 

flexi-auth | A user authentication library for CodeIgniter.
flexi-cart | An e-commerce shopping cart library for CodeIgniter.

 
Posted: 19 October 2012 09:11 PM   [ Ignore ]   [ # 72 ]   [ Rating: 0 ]
Joined: 2012-01-17
11 posts

I was wondering is it possible for your auth library to use SMTP to send emails?

 
Posted: 20 October 2012 05:26 AM   [ Ignore ]   [ # 73 ]   [ Rating: 0 ]
Joined: 2012-10-19
11 posts

@skunkbad @haseydesign thanks for your responses.

@haseydesign the problem is still there with your suggested update. Check it for yourself: http://flyinglow.hl31.dinaserver.com/development/


Best.

 
Posted: 20 October 2012 11:57 AM   [ Ignore ]   [ # 74 ]   [ Rating: 0 ]
Joined: 2012-01-17
11 posts

In regards to reply: http://ellislab.com/forums/viewthread/224351/P60/#1035977

I implemented the changes and works very very nicely. Thank you so much this also resolved a few issues in my thought process.

Great library!

 
Posted: 20 October 2012 08:00 PM   [ Ignore ]   [ # 75 ]   [ Rating: 0 ]
Avatar
Joined: 2009-07-26
818 posts

Hey dude,

Just saw this so I wanted to say good job.  Code looks great.  It definitely has a different philosophy than Ion Auth and that’s great for the community to have choice.

Take care dude!

 Signature 

BenEdmunds.com

Contact Me:                                    My Code: 

  ben.edmunds@gmail.com            Github
  @benedmunds

 
Posted: 22 October 2012 07:53 AM   [ Ignore ]   [ # 76 ]   [ Rating: 0 ]
Joined: 2012-03-08
159 posts

@davidinchi

Hey man, thanks for the direct link.
As you said in your previous message, I am also getting logged out once I’ve refreshed another page.
Although I’m getting this in IE, FF and Chrome, which suggests to me this isn’t browser specific.

If you go to the flexi-auth demo @ http://haseydesign.com/flexi-auth/auth - I would presume it works for you like it does for me?

If you can login, then this would suggest that there is something wrong with the implementation of your code rather than the library.

Can you try and install the flexi-auth demo on the same sever as your example and see if you can login to the demo?

Let us know how you get on.

 Signature 

flexi-auth | A user authentication library for CodeIgniter.
flexi-cart | An e-commerce shopping cart library for CodeIgniter.

 
Posted: 22 October 2012 07:54 AM   [ Ignore ]   [ # 77 ]   [ Rating: 0 ]
Joined: 2012-03-08
159 posts

@code_has_been_ignited
No problem man, come on by again if you need any further help.

@Ben Edmunds
Hey man its really cool you checked the library out.
You’re kind of like the libraries Godfather I guess, it wouldn’t have happened if you hadn’t of got me started with Ion Auth.

I was still pretty new to using CI when I started tweaking Ion Auth and I kind of just got carried away with trying to make a library that could cover all of a clients potential requirements. Before I knew it, it was a library all of its own - I then didn’t learn when to stop and ended up building flexi-cart too.

Cheers for dropping by!

 Signature 

flexi-auth | A user authentication library for CodeIgniter.
flexi-cart | An e-commerce shopping cart library for CodeIgniter.

 
Posted: 22 October 2012 08:11 AM   [ Ignore ]   [ # 78 ]   [ Rating: 0 ]
Joined: 2012-10-19
11 posts

@haseydesign

FF fails??!!

I’ve test it and FF is getting logged in in my case.

http://haseydesign.com/flexi-auth/auth  is working for me with Chrome, no problem.


I will install the flexi-auth demo on the same sever as you suggest. Thanks !!

haseydesign - 22 October 2012 07:53 AM

@davidinchi

Hey man, thanks for the direct link.
As you said in your previous message, I am also getting logged out once I’ve refreshed another page.
Although I’m getting this in IE, FF and Chrome, which suggests to me this isn’t browser specific.

If you go to the flexi-auth demo @ http://haseydesign.com/flexi-auth/auth - I would presume it works for you like it does for me?

If you can login, then this would suggest that there is something wrong with the implementation of your code rather than the library.

Can you try and install the flexi-auth demo on the same sever as your example and see if you can login to the demo?

Let us know how you get on.

 
Posted: 22 October 2012 08:19 AM   [ Ignore ]   [ # 79 ]   [ Rating: 0 ]
Joined: 2012-03-08
159 posts

@davidinchi

When I tried it earlier on FF whilst on my work computer, it did seem to be logging me out.
However, trying it now on my home computer and FF does seem to be working.

There definitely seems to be something a little strange about it.
Good luck with installing the demo on your server, let us know how you get on.

 Signature 

flexi-auth | A user authentication library for CodeIgniter.
flexi-cart | An e-commerce shopping cart library for CodeIgniter.

 
Posted: 24 October 2012 07:34 AM   [ Ignore ]   [ # 80 ]   [ Rating: 0 ]
Joined: 2007-10-16
55 posts

+ Login sessions are managed via a hashed session token technique as described by Barry Jaspan.
+ The session tokens mentioned above are further secured using CI’s encryption library.

Uh, why? In general, more encryption does not improve security, and often reduces it. Can you explain in more detail what you are doing there and why?

 
Posted: 24 October 2012 07:36 AM   [ Ignore ]   [ # 81 ]   [ Rating: 0 ]
Joined: 2010-10-26
84 posts
haseydesign - 19 October 2012 07:56 PM

@davidinchi

Yes you were right, there was a bug with the library and IE setting login cookies on the ‘Login via Ajax’ example.
Although I could only regenerate the bug in IE and not Chrome as you suggested.
However, I’m pretty sure the fix should address any browsers that were having the same issue.

You can get the fix from the usual Github repo.
The only file that needs to be updated is ‘flexi_auth_lite_model.php’.

Thank YOU! My God it drove me crazy today wondering what the heck was going on. I could only back trace it to the Flexi auth system. Updated to as per told, and the logout bug dissappeared.

Otherwise a great library! thanks!

 
Posted: 25 October 2012 04:30 AM   [ Ignore ]   [ # 82 ]   [ Rating: 0 ]
Joined: 2012-03-08
159 posts

@Tom Vogt

The feature list on the first post of this thread should not really have included that in the text.

What it was referring to is that the sessions that data is saved to via the flexi auth library CAN be encrypted using the CI config setting $config[‘sess_encrypt_cookie’].

It was badly worded and ended up sounding misleading; since that feature is within the core of CI, it
cannot really be listed as a feature of the library. I’ve since edited it out.

——————————————————————————————————————————————

@Swedie
Thanks for the feedback man, glad to hear you got things sorted.

 

 Signature 

flexi-auth | A user authentication library for CodeIgniter.
flexi-cart | An e-commerce shopping cart library for CodeIgniter.

 
Posted: 26 October 2012 06:42 AM   [ Ignore ]   [ # 83 ]   [ Rating: 0 ]
Joined: 2012-10-10
3 posts

Hi.
I want to thank you for great work.
But really am confusing foe how to implement it.
I church the demo,and check the libs file there is different in deploy.
I need your help to deploy it, shall I create new model or used yours, if you just simplicity it as follow ,login controller,, model login for interact with database.
I just want understand it as well.
I appreciate if you put simple code here for my login controlled and model.
Thank you.

 
Posted: 26 October 2012 07:16 AM   [ Ignore ]   [ # 84 ]   [ Rating: 0 ]
Joined: 2012-03-08
159 posts

@x2blue

Here’s the most basic demo example I can come up with for the basics for logging in via the flexi-auth library.

You will still need to install the demo database table and content for the example to work.
The login details are the same as given via the demo.

Once you get these basics of the library understood, you can then progress to developing your code further with validation and user redirects based on login status - as demonstrated via the demo.

controllers/your_controller.php

class Your_controller extends CI_Controller {
 
    
function __construct() 
    
{
        parent
::__construct();

  
$this->auth = new stdClass;
  
$this->load->library('flexi_auth'); 
 
}

    
function login()
    

  
// If 'Login' form has been submited, attempt to log the user in.
  
if ($this->input->post('login_user'))
  
{
   
// Verify login data.
   
$result $this->flexi_auth->login($this->input->post('login_identity'), $this->input->post('login_password'), $this->input->post('remember_me'));

   if (
$result)
   
{
    
die('Login Successful');
   
}
   
else
   
{
    
die('Login Failed | <a href="'.$_SERVER['PHP_SELF'].'">Retry Login</a>');
   
}
  }
  
else
  
{
   $this
->load->view('login_view');
  
}
    }

views/login_view.php

<!doctype html>
<
html>
<
head>
 <
title>flexi auth login example</title>
</
head>
<
body id="login">
 <
form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="POST">
  <
label for="identity">Email or Username:</label>
  <
input type="text" id="identity" name="login_identity" value="admin@admin.com"/>
  <
hr>
  <
label for="password">Password:</label>
  <
input type="password" id="password" name="login_password" value="password123"/>
  <
hr>
  <
label for="remember_me">Remember Me:</label>
  <
input type="checkbox" id="remember_me" name="remember_me" value="1"/>
  <
hr>
  <
label for="submit">Login:</label>
  <
input type="submit" name="login_user" id="submit" value="Submit"/>
 </
form>
</
body>
</
html
 Signature 

flexi-auth | A user authentication library for CodeIgniter.
flexi-cart | An e-commerce shopping cart library for CodeIgniter.

 
Posted: 26 October 2012 07:32 AM   [ Ignore ]   [ # 85 ]   [ Rating: 0 ]
Joined: 2012-10-10
3 posts

Very thanks. Shall I used model or this enough.
And for the data base if I need to extend it using profile or other operation . I used as you mentioned or shall create a model to handle it.
Thanks

 
5 of 17
5