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

Autologin not working #7

Closed
mpaskevi opened this Issue Oct 12, 2016 · 29 comments

Comments

Projects
None yet
3 participants
@mpaskevi

mpaskevi commented Oct 12, 2016

I am hitting a wall in getting this working in our wordpress network. Have the theme installed, user created, etc - have double checked the documentation. I can not get the /write page to resolve, have tried both with access code and without. The URL I land at after entering the code or hitting /write directly is /wp-login.php?autologin=writer

I am able to login to the site with the writer account and password which is used on the author account setup.

Any help would be appreciated! Thanks in advance,

@cogdog

This comment has been minimized.

Show comment
Hide comment
@cogdog

cogdog Oct 12, 2016

Owner

Bummer sorry about that.

Typically if you end up at that URL it's because of a password mismatch for the writer account, but you have verified that it works.

Just to verify, did the install create 4 Pages? Are there ones made for /write and /desk ??

Are the Permalink settings set to anything other than Plain? When you view the default "Hello World" post, does its URL have a ?p=xx in it? There might be an htaccess issue then.

Landing on /wp-login.php?autologin=writer means the automated login failed. I added a line to functions.php in the truwriter theme to have it display the error message. You can just replace that file in your theme.

I can only guess, seeing the site might help me debug

Owner

cogdog commented Oct 12, 2016

Bummer sorry about that.

Typically if you end up at that URL it's because of a password mismatch for the writer account, but you have verified that it works.

Just to verify, did the install create 4 Pages? Are there ones made for /write and /desk ??

Are the Permalink settings set to anything other than Plain? When you view the default "Hello World" post, does its URL have a ?p=xx in it? There might be an htaccess issue then.

Landing on /wp-login.php?autologin=writer means the automated login failed. I added a line to functions.php in the truwriter theme to have it display the error message. You can just replace that file in your theme.

I can only guess, seeing the site might help me debug

@mpaskevi

This comment has been minimized.

Show comment
Hide comment
@mpaskevi

mpaskevi Oct 12, 2016

Hi Alan,
Thanks for the quick reply!

The four pages created by the theme exist, Get edit link, Random, Welcome desk, Write? Write. Right. I edited my menu to create an about page and link to the Write page. I hit the Welcome desk when using an access code, that works well and verifies the access code properly .

Permalinks are set to Day and name, which puts hello world at 2016/10/12/hello-world/. I tried setting permalinks back to plain, but that creates problems when trying to navigate back to /desk or /write - only hello world shows. I have set the permalinks back to day and name.

I replaced functions.php for debugging. You can access the site at https://wordpress.viu.ca/learningcircle

Thanks again, Michael

mpaskevi commented Oct 12, 2016

Hi Alan,
Thanks for the quick reply!

The four pages created by the theme exist, Get edit link, Random, Welcome desk, Write? Write. Right. I edited my menu to create an about page and link to the Write page. I hit the Welcome desk when using an access code, that works well and verifies the access code properly .

Permalinks are set to Day and name, which puts hello world at 2016/10/12/hello-world/. I tried setting permalinks back to plain, but that creates problems when trying to navigate back to /desk or /write - only hello world shows. I have set the permalinks back to day and name.

I replaced functions.php for debugging. You can access the site at https://wordpress.viu.ca/learningcircle

Thanks again, Michael

@cogdog

This comment has been minimized.

Show comment
Hide comment
@cogdog

cogdog Oct 12, 2016

Owner

It sounds like everything is set up. I do need to make some changes so it
does not depend on a permalink setting, but that is not any issue for you.

I am not clear (because I can only see the desk) what happens- if I
understand correctly, instead of going to the page /write you end up on a
login page? I've not seen anything like this in about 20 setups, but there
is always a possibility I am missing something. The writer author is added
to this blog? I can only suspect something is funky with the account, maybe
delete the user and try creating again?

On Wed, Oct 12, 2016 at 6:36 AM, mpaskevi notifications@github.com wrote:

Hi Alan,
Thanks for the quick reply!

The four pages created by the theme exist, Get edit link, Random, Welcome
desk, Write? Write. Right. I edited my menu to create an about page and
link to the Write page. I hit the Welcome desk when using a access code,
that works well and verifies the access code properly .

Permalinks are set to Day and name, which puts hello world at
2016/10/12/hello-world/. I tried setting permalinks back to plan, but that
creates problems when trying to navigate back to /desk or /write - only
hello world shows. I have set the permalinks back to day and name.

I replaced functions.php for debugging. You can access the site at
https://wordpress.viu.ca/learningcircle

Thanks again, Michael


You are receiving this because you commented.
Reply to this email directly, view it on GitHub
#7 (comment), or mute
the thread
https://github.com/notifications/unsubscribe-auth/AAcQviQ2X539w8liL7kltBgguXs20Q23ks5qzOJegaJpZM4KUW08
.

*------------------------------------------------------------------------------------Alan
Levine: A Cog, A Dog, A Blog *
cog.dog • yep, that's my domain!

blog: cogdogblog.com • tweets: @cogdog http://twitter.com/cogdog

photos: flickr http://flickr.com/photos/cogdog & Barking Dog Studios
http://barkingdog.me • code: github.com/cogdog
50+ Web Ways to Tell a Story http://50ways.wikispaces.com • pechaflickr
http://pechaflickr.net • ds106 http://ds106.us/
------------------------------------------------------------------------------------

Owner

cogdog commented Oct 12, 2016

It sounds like everything is set up. I do need to make some changes so it
does not depend on a permalink setting, but that is not any issue for you.

I am not clear (because I can only see the desk) what happens- if I
understand correctly, instead of going to the page /write you end up on a
login page? I've not seen anything like this in about 20 setups, but there
is always a possibility I am missing something. The writer author is added
to this blog? I can only suspect something is funky with the account, maybe
delete the user and try creating again?

On Wed, Oct 12, 2016 at 6:36 AM, mpaskevi notifications@github.com wrote:

Hi Alan,
Thanks for the quick reply!

The four pages created by the theme exist, Get edit link, Random, Welcome
desk, Write? Write. Right. I edited my menu to create an about page and
link to the Write page. I hit the Welcome desk when using a access code,
that works well and verifies the access code properly .

Permalinks are set to Day and name, which puts hello world at
2016/10/12/hello-world/. I tried setting permalinks back to plan, but that
creates problems when trying to navigate back to /desk or /write - only
hello world shows. I have set the permalinks back to day and name.

I replaced functions.php for debugging. You can access the site at
https://wordpress.viu.ca/learningcircle

Thanks again, Michael


You are receiving this because you commented.
Reply to this email directly, view it on GitHub
#7 (comment), or mute
the thread
https://github.com/notifications/unsubscribe-auth/AAcQviQ2X539w8liL7kltBgguXs20Q23ks5qzOJegaJpZM4KUW08
.

*------------------------------------------------------------------------------------Alan
Levine: A Cog, A Dog, A Blog *
cog.dog • yep, that's my domain!

blog: cogdogblog.com • tweets: @cogdog http://twitter.com/cogdog

photos: flickr http://flickr.com/photos/cogdog & Barking Dog Studios
http://barkingdog.me • code: github.com/cogdog
50+ Web Ways to Tell a Story http://50ways.wikispaces.com • pechaflickr
http://pechaflickr.net • ds106 http://ds106.us/
------------------------------------------------------------------------------------

@mpaskevi

This comment has been minimized.

Show comment
Hide comment
@mpaskevi

mpaskevi Oct 12, 2016

I did try to follow the setup instructions carefully! I have removed the access code for now, so you can see the behaviour when hitting the write page.

I have removed the writer user; had to remove from site, then network, then database as the name was reserved. Still same issue persists. Have checked the writer can login with the wp generated password which has been copied into TRU Writer Options.

I can rebuild the site again from scratch if you think that might help? When I first installed I was able to get the write page to load, this was before applying any of the setup or even creating the writer account.

Other things to note that are perhaps unique here. I did not install Radcliffe, I did not interpret that might be a dependency. I also did not setup the Estimated Reading Time Plugin.

Thanks again for your time here :)

mpaskevi commented Oct 12, 2016

I did try to follow the setup instructions carefully! I have removed the access code for now, so you can see the behaviour when hitting the write page.

I have removed the writer user; had to remove from site, then network, then database as the name was reserved. Still same issue persists. Have checked the writer can login with the wp generated password which has been copied into TRU Writer Options.

I can rebuild the site again from scratch if you think that might help? When I first installed I was able to get the write page to load, this was before applying any of the setup or even creating the writer account.

Other things to note that are perhaps unique here. I did not install Radcliffe, I did not interpret that might be a dependency. I also did not setup the Estimated Reading Time Plugin.

Thanks again for your time here :)

@cogdog

This comment has been minimized.

Show comment
Hide comment
@cogdog

cogdog Oct 12, 2016

Owner

Okay, I have an idea now, but I am going to be out al day and cannot work
on this. You've done everything right.

It has to do with the server being run over a secure (https) connection,
and its something I will have to try adding an extra cookie to be created
before the login. If you are willing to test this, it will help me make a
fix that will work for everyone.

BTW. You do not need to install the Radcliffe theme, it is already present
on the multisite. The TRU Writer theme would be "broken" without it

On Wed, Oct 12, 2016 at 8:48 AM, mpaskevi notifications@github.com wrote:

I did try to follow the setup instructions carefully! I have removed the
access code for now, so you can see the behaviour when hitting the write
page.

I have removed the write user; had to remove from site, then network, then
database as the name was reserved. Still same issue persists. Have checked
the writer can login with the wp generated password which has been copied
into TRU Writer Options.

I can rebuild the site again from scratch if you think that might help?
When I first installed I was able to get the write page to load, this was
before applying any of the setup or even creating the writer account.

Other things to note that are perhaps unique here. I did not install
Radcliffe, I did not interpret that might be a dependency. I also did not
setup the Estimated Reading Time Plugin.

Thanks again for your time here :)


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#7 (comment), or mute
the thread
https://github.com/notifications/unsubscribe-auth/AAcQvmSGsgiCW8Mgs204nuOjVaFvl-kvks5qzQFOgaJpZM4KUW08
.

*------------------------------------------------------------------------------------Alan
Levine: A Cog, A Dog, A Blog *
cog.dog • yep, that's my domain!

blog: cogdogblog.com • tweets: @cogdog http://twitter.com/cogdog

photos: flickr http://flickr.com/photos/cogdog & Barking Dog Studios
http://barkingdog.me • code: github.com/cogdog
50+ Web Ways to Tell a Story http://50ways.wikispaces.com • pechaflickr
http://pechaflickr.net • ds106 http://ds106.us/
------------------------------------------------------------------------------------

Owner

cogdog commented Oct 12, 2016

Okay, I have an idea now, but I am going to be out al day and cannot work
on this. You've done everything right.

It has to do with the server being run over a secure (https) connection,
and its something I will have to try adding an extra cookie to be created
before the login. If you are willing to test this, it will help me make a
fix that will work for everyone.

BTW. You do not need to install the Radcliffe theme, it is already present
on the multisite. The TRU Writer theme would be "broken" without it

On Wed, Oct 12, 2016 at 8:48 AM, mpaskevi notifications@github.com wrote:

I did try to follow the setup instructions carefully! I have removed the
access code for now, so you can see the behaviour when hitting the write
page.

I have removed the write user; had to remove from site, then network, then
database as the name was reserved. Still same issue persists. Have checked
the writer can login with the wp generated password which has been copied
into TRU Writer Options.

I can rebuild the site again from scratch if you think that might help?
When I first installed I was able to get the write page to load, this was
before applying any of the setup or even creating the writer account.

Other things to note that are perhaps unique here. I did not install
Radcliffe, I did not interpret that might be a dependency. I also did not
setup the Estimated Reading Time Plugin.

Thanks again for your time here :)


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#7 (comment), or mute
the thread
https://github.com/notifications/unsubscribe-auth/AAcQvmSGsgiCW8Mgs204nuOjVaFvl-kvks5qzQFOgaJpZM4KUW08
.

*------------------------------------------------------------------------------------Alan
Levine: A Cog, A Dog, A Blog *
cog.dog • yep, that's my domain!

blog: cogdogblog.com • tweets: @cogdog http://twitter.com/cogdog

photos: flickr http://flickr.com/photos/cogdog & Barking Dog Studios
http://barkingdog.me • code: github.com/cogdog
50+ Web Ways to Tell a Story http://50ways.wikispaces.com • pechaflickr
http://pechaflickr.net • ds106 http://ds106.us/
------------------------------------------------------------------------------------

@mpaskevi

This comment has been minimized.

Show comment
Hide comment
@mpaskevi

mpaskevi Oct 12, 2016

Thanks again Alan, no rush. Please let me know what our next steps are when you return. Cheers,

mpaskevi commented Oct 12, 2016

Thanks again Alan, no rush. Please let me know what our next steps are when you return. Cheers,

@cogdog

This comment has been minimized.

Show comment
Hide comment
@cogdog

cogdog Oct 13, 2016

Owner

I do not have an answer for you, it is not a problem with https -- I just
set up a test version on my domain at https://lab.cogdogblog.com/writer/
and am able to go to the Writing form, so the autologin is working.

The next step is to ask your server/network admins if they have set up
extra security that might block what my code is trying to do, use if the
Wordpress wp_signon() function --
https://developer.wordpress.org/reference/functions/wp_signon/

Sorry. I cannot diagnose anything.

On Wed, Oct 12, 2016 at 9:14 AM, mpaskevi notifications@github.com wrote:

Thanks again Alan, no rush. Please let me know what our next steps are
when you return. Cheers,


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#7 (comment), or mute
the thread
https://github.com/notifications/unsubscribe-auth/AAcQvn0CShmNtsMyXpFah72fzqR0A39Nks5qzQdggaJpZM4KUW08
.

*------------------------------------------------------------------------------------Alan
Levine: A Cog, A Dog, A Blog *
cog.dog • yep, that's my domain!

blog: cogdogblog.com • tweets: @cogdog http://twitter.com/cogdog

photos: flickr http://flickr.com/photos/cogdog & Barking Dog Studios
http://barkingdog.me • code: github.com/cogdog
50+ Web Ways to Tell a Story http://50ways.wikispaces.com • pechaflickr
http://pechaflickr.net • ds106 http://ds106.us/
------------------------------------------------------------------------------------

Owner

cogdog commented Oct 13, 2016

I do not have an answer for you, it is not a problem with https -- I just
set up a test version on my domain at https://lab.cogdogblog.com/writer/
and am able to go to the Writing form, so the autologin is working.

The next step is to ask your server/network admins if they have set up
extra security that might block what my code is trying to do, use if the
Wordpress wp_signon() function --
https://developer.wordpress.org/reference/functions/wp_signon/

Sorry. I cannot diagnose anything.

On Wed, Oct 12, 2016 at 9:14 AM, mpaskevi notifications@github.com wrote:

Thanks again Alan, no rush. Please let me know what our next steps are
when you return. Cheers,


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#7 (comment), or mute
the thread
https://github.com/notifications/unsubscribe-auth/AAcQvn0CShmNtsMyXpFah72fzqR0A39Nks5qzQdggaJpZM4KUW08
.

*------------------------------------------------------------------------------------Alan
Levine: A Cog, A Dog, A Blog *
cog.dog • yep, that's my domain!

blog: cogdogblog.com • tweets: @cogdog http://twitter.com/cogdog

photos: flickr http://flickr.com/photos/cogdog & Barking Dog Studios
http://barkingdog.me • code: github.com/cogdog
50+ Web Ways to Tell a Story http://50ways.wikispaces.com • pechaflickr
http://pechaflickr.net • ds106 http://ds106.us/
------------------------------------------------------------------------------------

@cogdog

This comment has been minimized.

Show comment
Hide comment
@cogdog

cogdog Oct 13, 2016

Owner

Okay, thought about it, and tried one more approach with setting a secure
cookie. Can you give the updated functions.php a try?

On Wed, Oct 12, 2016 at 8:32 PM, Alan Levine cogdogblog@gmail.com wrote:

I do not have an answer for you, it is not a problem with https -- I just
set up a test version on my domain at https://lab.cogdogblog.com/writer/
and am able to go to the Writing form, so the autologin is working.

The next step is to ask your server/network admins if they have set up
extra security that might block what my code is trying to do, use if the
Wordpress wp_signon() function -- https://developer.
wordpress.org/reference/functions/wp_signon/

Sorry. I cannot diagnose anything.

On Wed, Oct 12, 2016 at 9:14 AM, mpaskevi notifications@github.com
wrote:

Thanks again Alan, no rush. Please let me know what our next steps are
when you return. Cheers,


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#7 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAcQvn0CShmNtsMyXpFah72fzqR0A39Nks5qzQdggaJpZM4KUW08
.

*------------------------------------------------------------------------------------Alan
Levine: A Cog, A Dog, A Blog *
cog.dog • yep, that's my domain!

blog: cogdogblog.com • tweets: @cogdog http://twitter.com/cogdog

photos: flickr http://flickr.com/photos/cogdog & Barking Dog Studios
http://barkingdog.me • code: github.com/cogdog
50+ Web Ways to Tell a Story http://50ways.wikispaces.com • pechaflickr
http://pechaflickr.net • ds106 http://ds106.us/

------------------------------------------------------------------------------------

*------------------------------------------------------------------------------------Alan
Levine: A Cog, A Dog, A Blog *
cog.dog • yep, that's my domain!

blog: cogdogblog.com • tweets: @cogdog http://twitter.com/cogdog

photos: flickr http://flickr.com/photos/cogdog & Barking Dog Studios
http://barkingdog.me • code: github.com/cogdog
50+ Web Ways to Tell a Story http://50ways.wikispaces.com • pechaflickr
http://pechaflickr.net • ds106 http://ds106.us/
------------------------------------------------------------------------------------

Owner

cogdog commented Oct 13, 2016

Okay, thought about it, and tried one more approach with setting a secure
cookie. Can you give the updated functions.php a try?

On Wed, Oct 12, 2016 at 8:32 PM, Alan Levine cogdogblog@gmail.com wrote:

I do not have an answer for you, it is not a problem with https -- I just
set up a test version on my domain at https://lab.cogdogblog.com/writer/
and am able to go to the Writing form, so the autologin is working.

The next step is to ask your server/network admins if they have set up
extra security that might block what my code is trying to do, use if the
Wordpress wp_signon() function -- https://developer.
wordpress.org/reference/functions/wp_signon/

Sorry. I cannot diagnose anything.

On Wed, Oct 12, 2016 at 9:14 AM, mpaskevi notifications@github.com
wrote:

Thanks again Alan, no rush. Please let me know what our next steps are
when you return. Cheers,


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#7 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAcQvn0CShmNtsMyXpFah72fzqR0A39Nks5qzQdggaJpZM4KUW08
.

*------------------------------------------------------------------------------------Alan
Levine: A Cog, A Dog, A Blog *
cog.dog • yep, that's my domain!

blog: cogdogblog.com • tweets: @cogdog http://twitter.com/cogdog

photos: flickr http://flickr.com/photos/cogdog & Barking Dog Studios
http://barkingdog.me • code: github.com/cogdog
50+ Web Ways to Tell a Story http://50ways.wikispaces.com • pechaflickr
http://pechaflickr.net • ds106 http://ds106.us/

------------------------------------------------------------------------------------

*------------------------------------------------------------------------------------Alan
Levine: A Cog, A Dog, A Blog *
cog.dog • yep, that's my domain!

blog: cogdogblog.com • tweets: @cogdog http://twitter.com/cogdog

photos: flickr http://flickr.com/photos/cogdog & Barking Dog Studios
http://barkingdog.me • code: github.com/cogdog
50+ Web Ways to Tell a Story http://50ways.wikispaces.com • pechaflickr
http://pechaflickr.net • ds106 http://ds106.us/
------------------------------------------------------------------------------------

@mpaskevi

This comment has been minimized.

Show comment
Hide comment
@mpaskevi

mpaskevi Oct 13, 2016

Alan, that might have done it! On first refresh I got the error message 'Bad news! login error: Please Login' but after backing out and returning I hit the write form. I will do some further testing this afternoon to confirm.

mpaskevi commented Oct 13, 2016

Alan, that might have done it! On first refresh I got the error message 'Bad news! login error: Please Login' but after backing out and returning I hit the write form. I will do some further testing this afternoon to confirm.

@mpaskevi

This comment has been minimized.

Show comment
Hide comment
@mpaskevi

mpaskevi Oct 13, 2016

I have just tested this further in a new browser, the same behaviour occurred. On the first attempt to hit the write page I get 'Bad news! login error: Please Login' with URL 'https://wordpress.viu.ca/learningcircle/wp-login.php?autologin=writer'

When I back out of that and return to try again, I am able to get to the write page.

mpaskevi commented Oct 13, 2016

I have just tested this further in a new browser, the same behaviour occurred. On the first attempt to hit the write page I get 'Bad news! login error: Please Login' with URL 'https://wordpress.viu.ca/learningcircle/wp-login.php?autologin=writer'

When I back out of that and return to try again, I am able to get to the write page.

@cogdog

This comment has been minimized.

Show comment
Hide comment
@cogdog

cogdog Oct 13, 2016

Owner

Okay getting closer.

I adjusted a few things to set the cookie earlier. Try updating
functions.php an page-desk.php

On Thu, Oct 13, 2016 at 8:43 AM, mpaskevi notifications@github.com wrote:

I have just tested this further in a new browser, the same behaviour
occoured. On the firwst attempt to hit the write page I get 'Bad news!
login error: Please Login' with URL 'https://wordpress.viu.ca/
learningcircle/wp-login.php?autologin=writer'

When I back out of that and return to try again, I am able to get to the
write page.


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#7 (comment), or mute
the thread
https://github.com/notifications/unsubscribe-auth/AAcQvqRGSJKYDaTbect9yzSyZ5gWib9Xks5qzlG7gaJpZM4KUW08
.

*------------------------------------------------------------------------------------Alan
Levine: A Cog, A Dog, A Blog *
cog.dog • yep, that's my domain!

blog: cogdogblog.com • tweets: @cogdog http://twitter.com/cogdog

photos: flickr http://flickr.com/photos/cogdog & Barking Dog Studios
http://barkingdog.me • code: github.com/cogdog
50+ Web Ways to Tell a Story http://50ways.wikispaces.com • pechaflickr
http://pechaflickr.net • ds106 http://ds106.us/
------------------------------------------------------------------------------------

Owner

cogdog commented Oct 13, 2016

Okay getting closer.

I adjusted a few things to set the cookie earlier. Try updating
functions.php an page-desk.php

On Thu, Oct 13, 2016 at 8:43 AM, mpaskevi notifications@github.com wrote:

I have just tested this further in a new browser, the same behaviour
occoured. On the firwst attempt to hit the write page I get 'Bad news!
login error: Please Login' with URL 'https://wordpress.viu.ca/
learningcircle/wp-login.php?autologin=writer'

When I back out of that and return to try again, I am able to get to the
write page.


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#7 (comment), or mute
the thread
https://github.com/notifications/unsubscribe-auth/AAcQvqRGSJKYDaTbect9yzSyZ5gWib9Xks5qzlG7gaJpZM4KUW08
.

*------------------------------------------------------------------------------------Alan
Levine: A Cog, A Dog, A Blog *
cog.dog • yep, that's my domain!

blog: cogdogblog.com • tweets: @cogdog http://twitter.com/cogdog

photos: flickr http://flickr.com/photos/cogdog & Barking Dog Studios
http://barkingdog.me • code: github.com/cogdog
50+ Web Ways to Tell a Story http://50ways.wikispaces.com • pechaflickr
http://pechaflickr.net • ds106 http://ds106.us/
------------------------------------------------------------------------------------

@mpaskevi

This comment has been minimized.

Show comment
Hide comment
@mpaskevi

mpaskevi Oct 13, 2016

Have updated functions.php and page-desk.php

The behaviour is the same. On the first attempt to hit the write page I get 'Bad news! login error: Please Login' with URL 'https://wordpress.viu.ca/learningcircle/wp-login.php?autologin=writer' When I back out of that and return to try again, I am able to get to the write page.

Thanks for your continued efforts here!

mpaskevi commented Oct 13, 2016

Have updated functions.php and page-desk.php

The behaviour is the same. On the first attempt to hit the write page I get 'Bad news! login error: Please Login' with URL 'https://wordpress.viu.ca/learningcircle/wp-login.php?autologin=writer' When I back out of that and return to try again, I am able to get to the write page.

Thanks for your continued efforts here!

@cogdog

This comment has been minimized.

Show comment
Hide comment
@cogdog

cogdog Oct 13, 2016

Owner

And thanks for keeping at this.

One more replacement of both of these files. I am trying to make sure the
cookie is set early enough in the Wordpress loading sequence.

On Thu, Oct 13, 2016 at 12:03 PM, mpaskevi notifications@github.com wrote:

Have updated functions.php and page-desk.php

The behaviour is the same. On the first attempt to hit the write page I
get 'Bad news! login error: Please Login' with URL '
https://wordpress.viu.ca/learningcircle/wp-login.php?autologin=writer'
When I back out of that and return to try again, I am able to get to the
write page.

Thanks for your continued efforts here!


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#7 (comment), or mute
the thread
https://github.com/notifications/unsubscribe-auth/AAcQvmTtdR3dhhDX4qIMDfriHGuP9dtAks5qzoB3gaJpZM4KUW08
.

*------------------------------------------------------------------------------------Alan
Levine: A Cog, A Dog, A Blog *
cog.dog • yep, that's my domain!

blog: cogdogblog.com • tweets: @cogdog http://twitter.com/cogdog

photos: flickr http://flickr.com/photos/cogdog & Barking Dog Studios
http://barkingdog.me • code: github.com/cogdog
50+ Web Ways to Tell a Story http://50ways.wikispaces.com • pechaflickr
http://pechaflickr.net • ds106 http://ds106.us/
------------------------------------------------------------------------------------

Owner

cogdog commented Oct 13, 2016

And thanks for keeping at this.

One more replacement of both of these files. I am trying to make sure the
cookie is set early enough in the Wordpress loading sequence.

On Thu, Oct 13, 2016 at 12:03 PM, mpaskevi notifications@github.com wrote:

Have updated functions.php and page-desk.php

The behaviour is the same. On the first attempt to hit the write page I
get 'Bad news! login error: Please Login' with URL '
https://wordpress.viu.ca/learningcircle/wp-login.php?autologin=writer'
When I back out of that and return to try again, I am able to get to the
write page.

Thanks for your continued efforts here!


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#7 (comment), or mute
the thread
https://github.com/notifications/unsubscribe-auth/AAcQvmTtdR3dhhDX4qIMDfriHGuP9dtAks5qzoB3gaJpZM4KUW08
.

*------------------------------------------------------------------------------------Alan
Levine: A Cog, A Dog, A Blog *
cog.dog • yep, that's my domain!

blog: cogdogblog.com • tweets: @cogdog http://twitter.com/cogdog

photos: flickr http://flickr.com/photos/cogdog & Barking Dog Studios
http://barkingdog.me • code: github.com/cogdog
50+ Web Ways to Tell a Story http://50ways.wikispaces.com • pechaflickr
http://pechaflickr.net • ds106 http://ds106.us/
------------------------------------------------------------------------------------

@mpaskevi

This comment has been minimized.

Show comment
Hide comment
@mpaskevi

mpaskevi Oct 13, 2016

It seems to be working!

The one issue is that I can not seem to run unauthenticated in one browser (firefox) and authenticated as admin in another (Chrome). When I load the write page in Firefox it seems to log me out of my admin role in Chrome. Perhaps the cookie needs to be browser specific? This is not huge as it is only likely to impact me, or any other authenticated user of the service (since we run a WP network). Any thoughts?

mpaskevi commented Oct 13, 2016

It seems to be working!

The one issue is that I can not seem to run unauthenticated in one browser (firefox) and authenticated as admin in another (Chrome). When I load the write page in Firefox it seems to log me out of my admin role in Chrome. Perhaps the cookie needs to be browser specific? This is not huge as it is only likely to impact me, or any other authenticated user of the service (since we run a WP network). Any thoughts?

@mpaskevi

This comment has been minimized.

Show comment
Hide comment
@mpaskevi

mpaskevi Oct 13, 2016

Further, I can re login with my admin account, but as soon as I return to the site where TRU-Writer is implemented I get reassigned to the writer user.

Also for the unauthenticated user in another browser, it would appear that filling in the write form and clicking save draft does not do anything. The write form is returned empty on click.

mpaskevi commented Oct 13, 2016

Further, I can re login with my admin account, but as soon as I return to the site where TRU-Writer is implemented I get reassigned to the writer user.

Also for the unauthenticated user in another browser, it would appear that filling in the write form and clicking save draft does not do anything. The write form is returned empty on click.

@cogdog

This comment has been minimized.

Show comment
Hide comment
@cogdog

cogdog Oct 13, 2016

Owner

Well, it's good news it works. I'd like to see some more testing by some
others, as I am not 100% sure I have covered all the possibilities. I doubt
I will go down the route of browser specific cookies, and I am not sure of
the use case of multiple logins.

There are these complexities when someone is logged in as a registered user
on the multisite, as their account won't work on the Writer site (unless
you want to give them access to the blog in editor mode; you can change the
settings on the Remove Dashboard Admin access to Admins only). If they are
logged in to a site they have access to use as an editor, it will skip
using the guest account.

It's a bit complicated. I have a bit of code that will put a special link
in the footer:

[image: Inline image 1]

If you are logged in as an admin or editor on the site, nothing will show.

A value of 1 means they are logged in as the special guest author.

A value of 0 means they are logged in as some other user on the multisite.

Clicking the 0 will log them out so they can use the special account.

On Thu, Oct 13, 2016 at 3:14 PM, mpaskevi notifications@github.com wrote:

It seems to be working!

The one issue is that I can not seem to run unauthenticated in one browser
(firefox) and authenticated as admin in another (Chrome). When I load the
write page in Firefox it seems to log me out of my admin role in Chrome.
Perhaps the cookie needs to be browser specific? This is not huge as it is
only likely to impact me, or any other authenticated user of the service
(since we run a WP network). Any thoughts?


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#7 (comment), or mute
the thread
https://github.com/notifications/unsubscribe-auth/AAcQvns0Mmy7LBb_rwyO4MaNita7hsebks5qzq0rgaJpZM4KUW08
.

*------------------------------------------------------------------------------------Alan
Levine: A Cog, A Dog, A Blog *
cog.dog • yep, that's my domain!

blog: cogdogblog.com • tweets: @cogdog http://twitter.com/cogdog

photos: flickr http://flickr.com/photos/cogdog & Barking Dog Studios
http://barkingdog.me • code: github.com/cogdog
50+ Web Ways to Tell a Story http://50ways.wikispaces.com • pechaflickr
http://pechaflickr.net • ds106 http://ds106.us/
------------------------------------------------------------------------------------

Owner

cogdog commented Oct 13, 2016

Well, it's good news it works. I'd like to see some more testing by some
others, as I am not 100% sure I have covered all the possibilities. I doubt
I will go down the route of browser specific cookies, and I am not sure of
the use case of multiple logins.

There are these complexities when someone is logged in as a registered user
on the multisite, as their account won't work on the Writer site (unless
you want to give them access to the blog in editor mode; you can change the
settings on the Remove Dashboard Admin access to Admins only). If they are
logged in to a site they have access to use as an editor, it will skip
using the guest account.

It's a bit complicated. I have a bit of code that will put a special link
in the footer:

[image: Inline image 1]

If you are logged in as an admin or editor on the site, nothing will show.

A value of 1 means they are logged in as the special guest author.

A value of 0 means they are logged in as some other user on the multisite.

Clicking the 0 will log them out so they can use the special account.

On Thu, Oct 13, 2016 at 3:14 PM, mpaskevi notifications@github.com wrote:

It seems to be working!

The one issue is that I can not seem to run unauthenticated in one browser
(firefox) and authenticated as admin in another (Chrome). When I load the
write page in Firefox it seems to log me out of my admin role in Chrome.
Perhaps the cookie needs to be browser specific? This is not huge as it is
only likely to impact me, or any other authenticated user of the service
(since we run a WP network). Any thoughts?


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#7 (comment), or mute
the thread
https://github.com/notifications/unsubscribe-auth/AAcQvns0Mmy7LBb_rwyO4MaNita7hsebks5qzq0rgaJpZM4KUW08
.

*------------------------------------------------------------------------------------Alan
Levine: A Cog, A Dog, A Blog *
cog.dog • yep, that's my domain!

blog: cogdogblog.com • tweets: @cogdog http://twitter.com/cogdog

photos: flickr http://flickr.com/photos/cogdog & Barking Dog Studios
http://barkingdog.me • code: github.com/cogdog
50+ Web Ways to Tell a Story http://50ways.wikispaces.com • pechaflickr
http://pechaflickr.net • ds106 http://ds106.us/
------------------------------------------------------------------------------------

@mpaskevi

This comment has been minimized.

Show comment
Hide comment
@mpaskevi

mpaskevi Oct 15, 2016

Thanks again, I can give it a try with my user group as many of them will not have an account in our network or if they are they would be in the minority and even less likely logged in at the same time.

I am not sure how to administer the site since currently as soon as I access the site or dashboard I am allocated the writer role. I suppose the only way would be to use an access code, which would prevent me getting that role until I entered the code. I could not regain access to the dashboard so I removed the writer user from the site (didnt work), removed the writer account from the network (didnt work, both of these actions still booted me out of my admin role). I then had to delete the site, but will try setting up another with the access code on. Unless you have any other ideas.

I recall that Brian Lamb mentioned it was possible to implement splot within a WP network, so I might ping him as well.

Thanks again!

mpaskevi commented Oct 15, 2016

Thanks again, I can give it a try with my user group as many of them will not have an account in our network or if they are they would be in the minority and even less likely logged in at the same time.

I am not sure how to administer the site since currently as soon as I access the site or dashboard I am allocated the writer role. I suppose the only way would be to use an access code, which would prevent me getting that role until I entered the code. I could not regain access to the dashboard so I removed the writer user from the site (didnt work), removed the writer account from the network (didnt work, both of these actions still booted me out of my admin role). I then had to delete the site, but will try setting up another with the access code on. Unless you have any other ideas.

I recall that Brian Lamb mentioned it was possible to implement splot within a WP network, so I might ping him as well.

Thanks again!

@cogdog

This comment has been minimized.

Show comment
Hide comment
@cogdog

cogdog Oct 15, 2016

Owner

Nothing quite drastic needed like removing the site. It's some kind of
conflict with cookies. Because I do not have a site exhibiting this
behavior I cannot really this issue. It's not an issue with multisite; I
set up two for Brian and one for another project, and in none of them is an
admin account knocked out when using the form.

On Sat, Oct 15, 2016 at 2:52 PM, mpaskevi notifications@github.com wrote:

Thanks again, I can give it a try with my user group as many of them will
not have an account in our network or if they are they would be in the
minority and even less likely logged in at the same time.

I am not sure how to administer the site since currently as soon as I
access the site or dashboard I am allocated the writer role. I suppose the
only way would be to use an access code, which would prevent me getting
that role until I entered the code. I could not regain access to the
dashboard so I removed the writer user from the site (didnt work), removed
the writer account from the network (didnt work, both of these actions
still booted me out of my admin role). I then had to delete the site, but
will try setting up another with the access code on. Unless you have any
other ideas.

I recall that Brian Lamb mentioned it was possible to implement splot
within a WP network, so I might ping him as well.

Thanks again!


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#7 (comment), or mute
the thread
https://github.com/notifications/unsubscribe-auth/AAcQvlSCIvKCMesKsvDZY33UEoBKet6Cks5q0UsugaJpZM4KUW08
.

*------------------------------------------------------------------------------------Alan
Levine: A Cog, A Dog, A Blog *
cog.dog • yep, that's my domain!

blog: cogdogblog.com • tweets: @cogdog http://twitter.com/cogdog

photos: flickr http://flickr.com/photos/cogdog & Barking Dog Studios
http://barkingdog.me • code: github.com/cogdog
50+ Web Ways to Tell a Story http://50ways.wikispaces.com • pechaflickr
http://pechaflickr.net • ds106 http://ds106.us/
------------------------------------------------------------------------------------

Owner

cogdog commented Oct 15, 2016

Nothing quite drastic needed like removing the site. It's some kind of
conflict with cookies. Because I do not have a site exhibiting this
behavior I cannot really this issue. It's not an issue with multisite; I
set up two for Brian and one for another project, and in none of them is an
admin account knocked out when using the form.

On Sat, Oct 15, 2016 at 2:52 PM, mpaskevi notifications@github.com wrote:

Thanks again, I can give it a try with my user group as many of them will
not have an account in our network or if they are they would be in the
minority and even less likely logged in at the same time.

I am not sure how to administer the site since currently as soon as I
access the site or dashboard I am allocated the writer role. I suppose the
only way would be to use an access code, which would prevent me getting
that role until I entered the code. I could not regain access to the
dashboard so I removed the writer user from the site (didnt work), removed
the writer account from the network (didnt work, both of these actions
still booted me out of my admin role). I then had to delete the site, but
will try setting up another with the access code on. Unless you have any
other ideas.

I recall that Brian Lamb mentioned it was possible to implement splot
within a WP network, so I might ping him as well.

Thanks again!


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#7 (comment), or mute
the thread
https://github.com/notifications/unsubscribe-auth/AAcQvlSCIvKCMesKsvDZY33UEoBKet6Cks5q0UsugaJpZM4KUW08
.

*------------------------------------------------------------------------------------Alan
Levine: A Cog, A Dog, A Blog *
cog.dog • yep, that's my domain!

blog: cogdogblog.com • tweets: @cogdog http://twitter.com/cogdog

photos: flickr http://flickr.com/photos/cogdog & Barking Dog Studios
http://barkingdog.me • code: github.com/cogdog
50+ Web Ways to Tell a Story http://50ways.wikispaces.com • pechaflickr
http://pechaflickr.net • ds106 http://ds106.us/
------------------------------------------------------------------------------------

@mpaskevi

This comment has been minimized.

Show comment
Hide comment
@mpaskevi

mpaskevi Oct 17, 2016

Ok, sorry I removed the site mostly because I could not retain control of it or get the access code applied. Any ideas of next steps here? Have you been able to isolate what is unique about our environment?

mpaskevi commented Oct 17, 2016

Ok, sorry I removed the site mostly because I could not retain control of it or get the access code applied. Any ideas of next steps here? Have you been able to isolate what is unique about our environment?

@cogdog

This comment has been minimized.

Show comment
Hide comment
@cogdog

cogdog Oct 18, 2016

Owner

I have no idea what I can determine about your environment. I cannot
reproduce what is happening on you site in any other site I have access to.

Sorry, I've hit a dead end.

On Mon, Oct 17, 2016 at 3:31 PM, mpaskevi notifications@github.com wrote:

Ok, sorry I removed the site mostly because I could not retain control of
it or get the access code applied. Any ideas of next steps here? Have you
been able to isolate what is unique about our environment?


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#7 (comment), or mute
the thread
https://github.com/notifications/unsubscribe-auth/AAcQvu8P9trDXvxOH2baiQ3nzDK-kQCTks5q0_cwgaJpZM4KUW08
.

*------------------------------------------------------------------------------------Alan
Levine: A Cog, A Dog, A Blog *
cog.dog • yep, that's my domain!

blog: cogdogblog.com • tweets: @cogdog http://twitter.com/cogdog

photos: flickr http://flickr.com/photos/cogdog & Barking Dog Studios
http://barkingdog.me • code: github.com/cogdog
50+ Web Ways to Tell a Story http://50ways.wikispaces.com • pechaflickr
http://pechaflickr.net • ds106 http://ds106.us/
------------------------------------------------------------------------------------

Owner

cogdog commented Oct 18, 2016

I have no idea what I can determine about your environment. I cannot
reproduce what is happening on you site in any other site I have access to.

Sorry, I've hit a dead end.

On Mon, Oct 17, 2016 at 3:31 PM, mpaskevi notifications@github.com wrote:

Ok, sorry I removed the site mostly because I could not retain control of
it or get the access code applied. Any ideas of next steps here? Have you
been able to isolate what is unique about our environment?


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#7 (comment), or mute
the thread
https://github.com/notifications/unsubscribe-auth/AAcQvu8P9trDXvxOH2baiQ3nzDK-kQCTks5q0_cwgaJpZM4KUW08
.

*------------------------------------------------------------------------------------Alan
Levine: A Cog, A Dog, A Blog *
cog.dog • yep, that's my domain!

blog: cogdogblog.com • tweets: @cogdog http://twitter.com/cogdog

photos: flickr http://flickr.com/photos/cogdog & Barking Dog Studios
http://barkingdog.me • code: github.com/cogdog
50+ Web Ways to Tell a Story http://50ways.wikispaces.com • pechaflickr
http://pechaflickr.net • ds106 http://ds106.us/
------------------------------------------------------------------------------------

@mpaskevi

This comment has been minimized.

Show comment
Hide comment
@mpaskevi

mpaskevi Oct 19, 2016

Oh shucks, well thanks for all of your help so far. I will perhaps try a fresh site and see if I make any progress.

mpaskevi commented Oct 19, 2016

Oh shucks, well thanks for all of your help so far. I will perhaps try a fresh site and see if I make any progress.

@Emrys78

This comment has been minimized.

Show comment
Hide comment
@Emrys78

Emrys78 Sep 14, 2018

Hi I came across this thread looking for a solution to this exact issue. Has there been any other solution found? I realise this is quite an old thread now.

My site is at https://iteach.csu.edu.au and it is a wordpress multisite install.
I have deleted /added the 'writer' account, checked passwords and so on but no success.

Works fine with logged in users.

Emrys78 commented Sep 14, 2018

Hi I came across this thread looking for a solution to this exact issue. Has there been any other solution found? I realise this is quite an old thread now.

My site is at https://iteach.csu.edu.au and it is a wordpress multisite install.
I have deleted /added the 'writer' account, checked passwords and so on but no success.

Works fine with logged in users.

@cogdog

This comment has been minimized.

Show comment
Hide comment
@cogdog

cogdog Sep 14, 2018

Owner

I am working with someone else who saw the same thing; it reports a badd user name password, but on a retry, it is logged in. Can you try an experiment? Try replacing functions.php with this test version

https://gist.github.com/cogdog/10cdd2cf59ecd1069a02785b88a33243

I am using a different method to assume the user which bypasses the wp_signon() and should be simpler

Owner

cogdog commented Sep 14, 2018

I am working with someone else who saw the same thing; it reports a badd user name password, but on a retry, it is logged in. Can you try an experiment? Try replacing functions.php with this test version

https://gist.github.com/cogdog/10cdd2cf59ecd1069a02785b88a33243

I am using a different method to assume the user which bypasses the wp_signon() and should be simpler

@Emrys78

This comment has been minimized.

Show comment
Hide comment
@Emrys78

Emrys78 Sep 14, 2018

Thank you for your prompt response. Unfortunately no: same issue. I can login manually using the writer account so I know the user/password is ok. On my local dev machine everything works (of course!). I also have a QA box at work I will test that on Monday.

Emrys78 commented Sep 14, 2018

Thank you for your prompt response. Unfortunately no: same issue. I can login manually using the writer account so I know the user/password is ok. On my local dev machine everything works (of course!). I also have a QA box at work I will test that on Monday.

@cogdog

This comment has been minimized.

Show comment
Hide comment
@cogdog

cogdog Sep 14, 2018

Owner

I can only guess w/o seeing it directly. What are the exact steps? Are you getting an error message?

Are you sure you replaced the functions.php with the one in my gist? The new method does not use the password, it's a way of enabling the user that does not use the regular WP login, no cookie use either.

Owner

cogdog commented Sep 14, 2018

I can only guess w/o seeing it directly. What are the exact steps? Are you getting an error message?

Are you sure you replaced the functions.php with the one in my gist? The new method does not use the password, it's a way of enabling the user that does not use the regular WP login, no cookie use either.

@Emrys78

This comment has been minimized.

Show comment
Hide comment
@Emrys78

Emrys78 Sep 17, 2018

Thanks for your help. The functions you posted didn't work unfortunately (at least in my install) but I got it working ok by modifying the page-write.php template at the top:

// ------------------------ front gate ------------------------
    if ( !is_user_logged_in() ) {
        // not already logged in? go to desk.
        // wp_redirect ( home_url('/') . 'desk'  );
        // exit;

        // Automatic login //
        $username = "writer";
        $user = get_user_by('login', $username );

        // Redirect URL //
        if ( !is_wp_error( $user ) )
        {
            wp_clear_auth_cookie();
            wp_set_current_user ( $user->ID );
            wp_set_auth_cookie  ( $user->ID );

            //$redirect_to = user_admin_url();
            //wp_safe_redirect( $redirect_to );
            //exit();
        }
    
    }

Emrys78 commented Sep 17, 2018

Thanks for your help. The functions you posted didn't work unfortunately (at least in my install) but I got it working ok by modifying the page-write.php template at the top:

// ------------------------ front gate ------------------------
    if ( !is_user_logged_in() ) {
        // not already logged in? go to desk.
        // wp_redirect ( home_url('/') . 'desk'  );
        // exit;

        // Automatic login //
        $username = "writer";
        $user = get_user_by('login', $username );

        // Redirect URL //
        if ( !is_wp_error( $user ) )
        {
            wp_clear_auth_cookie();
            wp_set_current_user ( $user->ID );
            wp_set_auth_cookie  ( $user->ID );

            //$redirect_to = user_admin_url();
            //wp_safe_redirect( $redirect_to );
            //exit();
        }
    
    }
@cogdog

This comment has been minimized.

Show comment
Hide comment
@cogdog

cogdog Sep 17, 2018

Owner

That's helpful, but for the site to work with options for the access code to get to the write page, it does need to be redirected to the /desk page. But what I see there for clearing cookies is what the general login function needs.

I appreciate this a lot, still not sure why only a few sites see this issue, but its definitely cookie related.

Owner

cogdog commented Sep 17, 2018

That's helpful, but for the site to work with options for the access code to get to the write page, it does need to be redirected to the /desk page. But what I see there for clearing cookies is what the general login function needs.

I appreciate this a lot, still not sure why only a few sites see this issue, but its definitely cookie related.

@Emrys78

This comment has been minimized.

Show comment
Hide comment
@Emrys78

Emrys78 Sep 17, 2018

Emrys78 commented Sep 17, 2018

@cogdog

This comment has been minimized.

Show comment
Hide comment
@cogdog

cogdog Sep 24, 2018

Owner

I've been making changes and it is working now on another site that was experiencing the same error you saw. I have removed all logins via autologin, and it clears/sets cookies the way you described. This is reflected in the new version.

There is also new code that logs out the writer user after publishing, so it clears any trace of this account

And yes, you were correct about the mixed content error; i was loading the cc image via http, now it is https (would have been cleaner as a new issue, but no complaints here)

Will be closing this issue.

Owner

cogdog commented Sep 24, 2018

I've been making changes and it is working now on another site that was experiencing the same error you saw. I have removed all logins via autologin, and it clears/sets cookies the way you described. This is reflected in the new version.

There is also new code that logs out the writer user after publishing, so it clears any trace of this account

And yes, you were correct about the mixed content error; i was loading the cc image via http, now it is https (would have been cleaner as a new issue, but no complaints here)

Will be closing this issue.

@cogdog cogdog closed this Sep 24, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment