Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CI 4 #1270

Closed
bvrignaud opened this issue Sep 17, 2018 · 57 comments
Closed

CI 4 #1270

bvrignaud opened this issue Sep 17, 2018 · 57 comments

Comments

@bvrignaud
Copy link
Contributor

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
Copy link
Owner

That sounds good to me!

@bvrignaud
Copy link
Contributor Author

Started.
I will send you a pull request asap.

@bvrignaud
Copy link
Contributor Author

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
Copy link
Owner

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

@bvrignaud
Copy link
Contributor Author

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

@benedmunds
Copy link
Owner

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

@bvrignaud
Copy link
Contributor Author

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
Copy link
Owner

@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
Copy link
Contributor

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
Copy link
Owner

@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
Copy link
Contributor Author

bvrignaud commented Mar 31, 2019

@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
Copy link
Contributor Author

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

@benedmunds
Copy link
Owner

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

@benedmunds
Copy link
Owner

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

@aryaei2000
Copy link

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
Copy link
Contributor Author

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

@aryaei2000
Copy link

So how come I can not find it on packagist?

@aryaei2000
Copy link

Any solution on this?

@benedmunds
Copy link
Owner

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

@aryaei2000
Copy link

@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
- Installation request for benedmunds/codeigniter-ion-auth 4.0.0 -> satisfiable by benedmunds/codeigniter-ion-auth[4.0.0].
- benedmunds/codeigniter-ion-auth 4.0.0 requires codeigniter4/framework develop-dev -> no matching package found.

Potential causes:

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

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

@benedmunds
Copy link
Owner

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
Copy link
Owner

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

composer init
composer config minimum-stability dev
composer config repositories.ionAuth vcs [email protected]:benedmunds/CodeIgniter-Ion-Auth.git
composer require benedmunds/CodeIgniter-Ion-Auth:4.x-dev

@aryaei2000
Copy link

@benedmunds checked it and it works. Thanks.

@datamweb
Copy link
Contributor

datamweb commented Jul 23, 2019

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
Copy link
Owner

@datamweb can you post your directory structure?

@datamweb
Copy link
Contributor

datamweb commented Jul 23, 2019

@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
Copy link
Owner

@bvrignaud any ideas here?

@bvrignaud
Copy link
Contributor Author

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

@datamweb
Copy link
Contributor

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
Copy link
Contributor Author

bvrignaud commented Jul 30, 2019

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

@datamweb
Copy link
Contributor

@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
Copy link
Contributor Author

@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
Copy link
Owner

benedmunds commented Aug 20, 2019

Email lib is back for CI4 🎉

codeigniter4/CodeIgniter4#2092

/cc @bvrignaud

@bvrignaud
Copy link
Contributor Author

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
Copy link

wingdu commented Jan 1, 2020

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
Copy link
Owner

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

@wingdu
Copy link

wingdu commented Jan 1, 2020

Hey,

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

@benedmunds
Copy link
Owner

benedmunds commented Jan 1, 2020

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

Maybe var dump that whole view file path

@wingdu
Copy link

wingdu commented Jan 2, 2020

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
Copy link
Owner

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
Copy link

wingdu commented Jan 6, 2020

thanks it working now !

@pickbreaker
Copy link

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
Copy link

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

@benedmunds
Copy link
Owner

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

@coderix44
Copy link

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
Copy link
Contributor

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
Copy link

Issue is resolved. Thank you

@coderix44
Copy link

coderix44 commented Jul 15, 2020 via email

@willcox
Copy link

willcox commented Sep 22, 2020

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

@willcox
Copy link

willcox commented Sep 22, 2020

please need your help guys

@benedmunds
Copy link
Owner

@willcox Hey. The Github repo is not for general support requests. I suggest you post a detailed message of what you've tried and what's not working on either StackOverflow or the CI Forums.

If you're strictly looking for a tutorial than here is one for CI3, the process will be similar:
http://avenir.ro/authentication-system-with-ion-auth-and-ci3/

@willcox
Copy link

willcox commented Sep 22, 2020

thanks!

@musaddiq-pk
Copy link

Does this support any sort of authorisation? I've read all of the above comments and installation guide and could not found anything regarding authorisation.

@benedmunds
Copy link
Owner

@musaddiq-pk there is group based authentication but nothing built in for ACL or more fine grained solutions

@musaddiq-pk
Copy link

musaddiq-pk commented Sep 23, 2020

Okay, thanks for quick reply. Any suggestion how we can easily embed ACL with this?

@benedmunds
Copy link
Owner

@musaddiq-pk I’ve seen this around but never used it myself:
https://github.com/weblogics/Codeigniter-Ion-Auth-ACL

@musaddiq-pk
Copy link

Thanks for sharing the info link. I will check this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests