benedmunds / CodeIgniter-Ion-Auth

Simple and Lightweight Auth System for CodeIgniter
http://benedmunds.com/ion_auth/
MIT License
2.34k stars 1.14k forks source link

CI 4 #1270

Closed bvrignaud closed 4 years ago

bvrignaud commented 6 years ago

Hello,

CodeIgniter 4 is currently in alpha phase.

I think it's time to launch a new '4' branch of Ion-auth. I have no mission at this time, so I have time to start it.

What did you think?

benedmunds commented 6 years ago

That sounds good to me!

bvrignaud commented 5 years ago

Started. I will send you a pull request asap.

bvrignaud commented 5 years ago

Hello @benedmunds ,

As you can see, I make e new 4 branch on my repository : https://github.com/bvrignaud/CodeIgniter-Ion-Auth/tree/4

Can you create a new '4' branch please ?

benedmunds commented 5 years ago

@bvrignaud done, I branched it from the 3 branch.

bvrignaud commented 5 years ago

The composer installer doesn't works. Could someone help me to make this work please ?

benedmunds commented 5 years ago

@bvrignaud sorry just saw the comment above. Still having issues with composer?

bvrignaud commented 5 years ago

Hello @benedmunds ,

Sorry for my late response, I do not have much free time at this time.

I quickly try to install IonAuth (4) with composer, but that does not seem to work. From what I read, you have to make a release of it, for IonAuth will be availble on Packagist.

I'm not familiar with making Composer package, so I'm not sure about all of that.

Thanks.

benedmunds commented 5 years ago

@bvrignaud this should be fixed now, made a documentation change. Can you test as well to make sure it works for you as well.

robertkendrick commented 5 years ago

Hi Small (syntactical) problem with SQLite3 and migration file:

`$ php spark migrate:latest -n IonAuth

CodeIgniter CLI Tool - Version 4.0.0-beta.1 - Server-Time: 2019-03-21 14:11:07pm

Migrating to latest version...

SQLite3::exec(): near "COLLATE": syntax error C:\Users\HP\Documents\PHP_web_sites\bktutor_CodeIgniter4-develop\system\Database\SQLite3\Conne ction.php - 167 Quick and dirty edit to migrations file: // $this->forge->createTable($this->tables['users'], false, ['COLLATE' => 'utf8_general_ci']); $this->forge->createTable($this->tables['users'], false); Produces working migration: $ php spark migrate:latest -n IonAuth

CodeIgniter CLI Tool - Version 4.0.0-beta.1 - Server-Time: 2019-03-21 14:15:25pm

Migrating to latest version... Running: (IonAuth) 20181211100537_install_ion_auth Done `

benedmunds commented 5 years ago

@robertkendrick thanks for this! Would you mind sending a PR to the 4 branch with the change? Makes it easier to merge and will track your contribution for the future.

bvrignaud commented 5 years ago

@bvrignaud this should be fixed now, made a documentation change. Can you test as well to make sure it works for you as well.

@benedmunds It'doesn't work for me. I have this message : Could not find a matching version of package benedmunds/CodeIgniter-Ion-Auth. Check the package spelling, your version constraint and that the package is available in a stability which matche
s your minimum-stability (stable).

bvrignaud commented 5 years ago

CI team has removed email library from main branch (https://forum.codeigniter.com/thread-72976.html) :-(. Any idea ?

benedmunds commented 5 years ago

@bvrignaud try the install again, I added a command for setting up the repo

benedmunds commented 5 years ago

@bvrignaud as far as email is concerned... maybe we use the one from the feature branch?

aryaei2000 commented 5 years ago

Hi,

Once I try installing Ion Auth 4 via composer, I get this error:

  - Installation request for benedmunds/codeigniter-ion-auth 4.x-dev -> satisfiable by benedmunds/codeigniter-ion-auth[4.x-dev].
  - benedmunds/codeigniter-ion-auth 4.x-dev requires codeigniter4/codeigniter4 dev-master -> no matching package found.

I noticed in composer.json file the requirement is set like this: "codeigniter4/codeigniter4": "dev-master"

While on packagist the name is different: "codeigniter4/codeigniter4-standard": "^1.0",

bvrignaud commented 5 years ago

This are 2 differents packages : codeigniter4/codeigniter4 != codeigniter4/codeigniter4-standard

aryaei2000 commented 5 years ago

So how come I can not find it on packagist?

aryaei2000 commented 5 years ago

Any solution on this?

benedmunds commented 5 years ago

@aryaei2000 I just pushed an update that has CodeIgniter's current namespacing/package name. Can you pull and try again please.

aryaei2000 commented 5 years ago

@aryaei2000 I just pushed an update that has CodeIgniter's current namespacing/package name. Can you pull and try again please.

@benedmunds Thanks for the update.

But the problem seems to persist. Here is the error I get.

`./composer.json has been updated Loading composer repositories with package information Updating dependencies (including require-dev) Your requirements could not be resolved to an installable set of packages.

Problem 1

Potential causes:

Read https://getcomposer.org/doc/articles/troubleshooting.md for further common problems.

Installation failed, reverting ./composer.json to its original content. `

benedmunds commented 5 years ago

Been debugging this, if you do a git pull and composer install from the codebase it will work now. Requiring it based on the tag is still broken, I'll work on it more next week.

benedmunds commented 5 years ago

@arif2009 figured it out. Try these updated install instructions:

composer init
composer config minimum-stability dev
composer config repositories.ionAuth vcs git@github.com:benedmunds/CodeIgniter-Ion-Auth.git
composer require benedmunds/CodeIgniter-Ion-Auth:4.x-dev
aryaei2000 commented 5 years ago

@benedmunds checked it and it works. Thanks.

datamweb commented 5 years ago

Hi,I struggled to install the Ion-Auth 4 . CI version: 4.0.0-beta.3 Ion-Auth version: 4.0.3 I tried to install it manually but from the following page request: http: //localhost/daminP/public/index.php/auth The following error is displayed. 404 - File Not Found Controller or its method is not found: App \ Controllers \ Auth :: login How can I fix this problem?

benedmunds commented 5 years ago

@datamweb can you post your directory structure?

datamweb commented 5 years ago

@datamweb can you post your directory structure?

CI4                          # → Root Directory(http://localhost/daminP/)
├── app/
│    ├── config/
│    │   └── IonAuth.php
│    ├── controllers/
│    │   └── Auth.php
│    ├── libraries
│    │   └── IonAuth.php
│    ├── models
│    │   └── IonAuthModel.php
│    └── views/
│       └── auth/           
│       └── Messages/           
├──public/
├── system/
├──writable/
├── and other CI base files
benedmunds commented 5 years ago

@bvrignaud any ideas here?

bvrignaud commented 5 years ago

What's the namespace of your Auth controller ? It must be "namespace App\Controllers;"

datamweb commented 5 years ago

What's the namespace of your Auth controller ? It must be "namespace App\Controllers;"

Hi @bvrignaud. Well I've used the default files unchanged. Now, I changed the namespace IonAuth\Controllers; to namespace App\Controllers;but the following text is displayed: Whoops! We seem to have hit a snag. Please try again later...

bvrignaud commented 5 years ago

Can you add this line to your .env file : "CI_ENVIRONMENT = development" ; to have more information please. What is your CI version ?

datamweb commented 5 years ago

@bvrignaud , CI V: 4.0.0-beta.3 and 4.0.0-beta.4 Ion-Auth V : 4.0.3 I also test at localhost. In the development mode shown below: APPPATH/Controllers\Auth.php at line 73


71     public function __construct()
72     {
**73         $this->ionAuth    = new \IonAuth\Libraries\IonAuth();**
74         $this->validation = \Config\Services::validation();
75         helper(['form', 'url']);
76         $this->configIonAuth = config('IonAuth');
77         $this->session       = \Config\Services::session();
78 
79         if (! empty($this->configIonAuth->templates['errors']['list']))
80         {
bvrignaud commented 5 years ago

@datamweb I use '4.0.0-alpha.4'. It's an old one. When I started to port IonAuth to CI4, there was an Email library based on the old one, but since few month, CI concil have decided to remove the email library, until they have a modern one. So actually, I don't know how to provide IonAuth for newest CI with email support.

Have you try to add this line to your .env file : "CI_ENVIRONMENT = development" ; (to have more information) ?

benedmunds commented 5 years ago

Email lib is back for CI4 🎉

https://github.com/codeigniter4/CodeIgniter4/pull/2092

/cc @bvrignaud

bvrignaud commented 5 years ago

Great news.

I will work on it as soon as possible.

If somebody is free to work on it, go one, I'm so busy actually.

wingdu commented 4 years ago

Hey,

i have checked out ion auth trough the composer and he load all automaical but.

When i try to open now http://myurl/auth then i get follow error message:

0 /var/www/kuendigung/html/system/View/View.php(224): CodeIgniter\Exceptions\FrameworkException::forInvalidFile('IonAuth\Views\a...')

1 /var/www/kuendigung/html/system/Common.php(176): CodeIgniter\View\View->render('IonAuth\Views\a...', Array, NULL)

2 /var/www/kuendigung/html/vendor/benedmunds/codeigniter-ion-auth/Controllers/Auth.php(923): view('IonAuth\Views\a...', Array)

3 /var/www/kuendigung/html/vendor/benedmunds/codeigniter-ion-auth/Controllers/Auth.php(173): IonAuth\Controllers\Auth->renderPage('IonAuth\Views\a...', Array)

4 /var/www/kuendigung/html/system/CodeIgniter.php(847): IonAuth\Controllers\Auth->login()

5 /var/www/kuendigung/html/system/CodeIgniter.php(338): CodeIgniter\CodeIgniter->runController(Object(IonAuth\Controllers\Auth))

6 /var/www/kuendigung/html/system/CodeIgniter.php(246): CodeIgniter\CodeIgniter->handleRequest(NULL, Object(Config\Cache), false)

7 /var/www/kuendigung/html/public/index.php(45): CodeIgniter\CodeIgniter->run()

8 {main}

benedmunds commented 4 years ago

@wingdu can you expand and post those first couple lines of the stack trace

wingdu commented 4 years ago

Hey,

take a look: https://www.kuendigung.site/auth/login

benedmunds commented 4 years ago

Can you make sure that the $viewsFolder path is correct?

Maybe var dump that whole view file path

wingdu commented 4 years ago

Hey Ben,

honestly i have only find some entrys in the config file for that. I have it directly checked out over the composer so all files are located under vendor/

benedmunds commented 4 years ago

Did you follow the instructions here https://github.com/benedmunds/CodeIgniter-Ion-Auth/blob/4/INSTALLING.md ?

Specifically, make sure you have setup the autload path in your config correctly.

wingdu commented 4 years ago

thanks it working now !

pickbreaker commented 4 years ago

Don't waist your time trying to install this one. It don't work and when researching no one has been able to get an auth to work in codeigniter 4 yet.

Well it is definitely working in my test installation im using for porting a web application of mine. So I'm quite convinced someone got an auth working.

samyambhandari commented 4 years ago

include_once(C:\xampp\htdocs\kumarijob\vendor\benedmunds\codeigniter-ion-auth): failed to open stream: Permission denied while composer update

benedmunds commented 4 years ago

What user are you running composer as? Does that user have permission to create directories there?

coderix44 commented 4 years ago

hi, i tried to use ion-auth 4 in my ci4 application. i am getting Class 'IonAuth\Libraries\IonAuth' not found error. please help urgently Capture

robertkendrick commented 4 years ago

This is almost certainly a config issue rather than IonAuth. Have you put an entry into app/config/Autoload.php. In the psr4 array there should be an entry with key = 'IonAuth' and value = 'path where you put the IonAuth software' For example, in Autoload.php $psr4 = [ 'IonAuth' => APPPATH . 'ThirdParty\IonAuth\', .... ] regards

coderix44 commented 4 years ago

Issue is resolved. Thank you

coderix44 commented 4 years ago

the issue got fixed. Thank you

On Tue, 14 Jul 2020 at 19:11, Yashvant Suthar notifications@github.com wrote:

ErrorException include_once(/var/www/html/vendor/benedmunds/codeigniter-ion-auth): failed to open stream: Success

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/benedmunds/CodeIgniter-Ion-Auth/issues/1270#issuecomment-658186257, or unsubscribe https://github.com/notifications/unsubscribe-auth/AQCUZOON6MHIX45JCBN4VUTR3ROCBANCNFSM4FVOS3EA .

willcox commented 4 years ago

please somebody know how to integrate ion auth in codeIgniter 4 form begining up to resgistering users?

willcox commented 4 years ago

please need your help guys