• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[split] Ion-Auth with CI4

(11-01-2019, 06:12 AM)MGatner Wrote: IonAuth is great, I have all respect for it. It is not a very good example of a CodeIgniter 4 module nor does it leverage a lot of the strength of CI4. It is a port of a library from CI3 so lacks support for a number of features in CI4. The docs are not valid for CI4 so its a little hard to tell but it seems like developers either need to extend the IonAuth controller (which precludes extending another Controller, like the framework resource controllers) or implement their own use of the library in filters/controllers.

I encourage everyone to check out Lonnie's Myth:Auth (https://github.com/lonnieezell/myth-auth) as both an example of a specifically-CI4 module and as an authentication/authorization library that leverages the frameworks strength, notably for authentication: filters, validation, and handles wrapped by services. But also named routes, CLI commands, toolbar collector, permissive entities, etc.

There's a lot that is worth doing the "CI4 way", and while libraries port fairly easily from CI3 (see the current CI4 Email library for example) I recommend rewriting over porting whenever resources permit.

There is NO need to extend Ion Auth controller. 

Just need to load the library... 

PHP Code:
        //Pre loads the Authentication Library: ION AUTH
$this->ionAuth = new \IonAuth\Libraries\IonAuth(); 

And check for login:

PHP Code:
if ( $this->ionAuth->loggedIn() ) {


Simple as that... 

Myth:Auth is awesome and Lonnie is doing a SUPERB job ! But so far I was not able to install or use the library....  Huh  ... and Ion Auth is simple as unzipping the file, changing some configs and... you are ready to go !

Messages In This Thread
[split] Ion-Auth with CI4 - by Poetawd - 10-26-2019, 07:33 PM
RE: [split] Ion-Auth with CI4 - by orionstar - 10-29-2019, 03:20 AM
RE: [split] Ion-Auth with CI4 - by Poetawd - 10-30-2019, 05:03 PM
RE: [split] Ion-Auth with CI4 - by MGatner - 11-01-2019, 06:12 AM
RE: [split] Ion-Auth with CI4 - by Poetawd - 11-01-2019, 06:53 AM
RE: [split] Ion-Auth with CI4 - by XTAZ - 11-12-2019, 12:51 PM
RE: [split] Ion-Auth with CI4 - by Poetawd - 11-12-2019, 06:31 PM

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  

  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.