AzureAD / active-directory-b2c-wordpress-plugin-openidconnect

A plugin for WordPress that allows users to authenticate with Azure AD B2C using OpenID Connect.
MIT License
31 stars 28 forks source link

Error 404 - Not found #8

Closed batguyz closed 7 years ago

batguyz commented 7 years ago

I have the plugin installed with the settings and all. However when I try to login via the admin url I get a 404 error message. To my understanding when the plugin is installed with proper configuration I should be redirected to a microsoft page starting with this url: https://login.microsoftonline.com/ But instead I don't get redirected and see a 404 page instead.

I've looked at some of the plugin files but cannot find any error. Any ideas what could be wrong?

Thanks.

TheSaltyKorean commented 7 years ago

Not sure if your issue is the same one that I had, but in my fork I fixed two issues. One of them had to do with a bad WP call, and the other with the fact I needed it under a \blog\ folder. You might go through my fork, remove the \blog modifications, then see if it works.

batguyz commented 7 years ago

Thanks Vonlar. I have eliminated the folder problem so at the moment the 404 is gone and the parameters work however I have a new issue. The new issue is that when I try to login from my site it shows the Microsoft login url briefly before redirecting back to the site without prompting me to login at all. In other words its omitting the Microsoft login page and not prompting me to login or sign up.

I tested the parameters on Azure B2C and it runs fine. I suspect something with the policy name but I'm not sure. Other than the bugs you fixed did you experience something like this? or is there some setting missing in Azure B2C? Thanks

TheSaltyKorean commented 7 years ago

Honestly, it's been too long for me to know what exactly I had to fix. You can take a look at the check-in and see the diff.

There are several parameters for the policy that has to be set. You can go to your database and try and change those. I have a feeling this may be what you're having a problem with now.

batguyz commented 7 years ago

Thanks. At this point I'm not sure if its the plugin or if the policy parameters or other settings are not quite right since it does not let me authenticate when I try to login on the website. Did you mean change the policy parameters in the Azure B2C database or the wordpress database?

If anything else comes to mind please share, it will be of great help!

TheSaltyKorean commented 7 years ago

Wordpress, you have to get the policy details exactly right else it fails

batguyz commented 7 years ago

I'll try that and let you know. Thanks

batguyz commented 7 years ago

I was able to fix the problem by including url/b2c-token-verification in the reply URL. I also had the Verify ID Tokens unchecked in the plugin. Thanks for the help. A quick question though, I know it's been a while you worked on the project but at the time did you manage to create custom fields in B2C say EmployeeID and write to WP?

Thanks!

TheSaltyKorean commented 7 years ago

@batguyz Good to hear. I have not tried to map the custom fields.

gsacavdm commented 7 years ago

Hey guys, we've made some changes to improve this sample adding better messaging around the settings, better error handling and addressing some of the other issues called out here. It would be great if you guys can try it out and give us more feedback. I'll close this issue and we'll keep an eye out for new ones.