# Redirected to Wordpress dashboard after discourse login

**URL:** https://meta.discourse.org/t/redirected-to-wordpress-dashboard-after-discourse-login/60116
**Category:** WordPress
**Created:** [29 maart 2017 om 15:41 UTC](https://meta.discourse.org/t/redirected-to-wordpress-dashboard-after-discourse-login/60116 "2017-03-29T15:41:28Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![Martin\_O](https://avatars.discourse-cdn.com/v4/letter/m/ea666f/32.png) [@Martin\_O](https://meta.discourse.org/u/Martin_O)
#### Post date: [29 maart 2017 om 15:41 UTC](https://meta.discourse.org/t/redirected-to-wordpress-dashboard-after-discourse-login/60116/1 "2017-03-29T15:41:28Z")

</div>

We use discourse together with wordpress, which is the sso provider.  
After latest update of discourse docker container and the [wp discourse](https://github.com/discourse/wp-discourse) plugin, I am not able to access discourse forums while logged in. It always redirects to the Wordpress dashboard, after entering the credentials, instead of showing main Discourse page.

I suspect that it is some simple discourse redirection causing this, can somebody advice where to look first, what can be causing this? The discourse admin pages became inaccessible because of this issue, but I can edit things on commandline,of course.

Thank you  
Martin

---

<div class="post-metadata">

### Author: ![simon](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/simon/32/339122_2.png) [@simon](https://meta.discourse.org/u/simon)
#### Post date: [29 maart 2017 om 16:15 UTC](https://meta.discourse.org/t/redirected-to-wordpress-dashboard-after-discourse-login/60116/2 "2017-03-29T16:15:08Z")

</div>

Can you check the SSO settings on WordPress and make sure they are still enabled? It’s possible that they were disabled during the update.

---

<div class="post-metadata">

### Author: ![simon](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/simon/32/339122_2.png) [@simon](https://meta.discourse.org/u/simon)
#### Post date: [29 maart 2017 om 17:14 UTC](https://meta.discourse.org/t/redirected-to-wordpress-dashboard-after-discourse-login/60116/4 "2017-03-29T17:14:22Z")

</div>

I’m not able to reproduce this. Can you let me know if it continues to be a problem?

---

<div class="post-metadata">

### Author: ![Martin\_O](https://avatars.discourse-cdn.com/v4/letter/m/ea666f/32.png) [@Martin\_O](https://meta.discourse.org/u/Martin_O)
#### Post date: [29 maart 2017 om 17:55 UTC](https://meta.discourse.org/t/redirected-to-wordpress-dashboard-after-discourse-login/60116/5 "2017-03-29T17:55:32Z")

</div>

Simon, thanks for reply. I checked the plugin status and it is activated. After forum searching, I am now able to access discourse admin pages using sso bypass ( /users/admin-login url ). I will check all the related sso options on Discourse side. The issue persists.  
Martin

---

<div class="post-metadata">

### Author: ![simon](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/simon/32/339122_2.png) [@simon](https://meta.discourse.org/u/simon)
#### Post date: [29 maart 2017 om 18:01 UTC](https://meta.discourse.org/t/redirected-to-wordpress-dashboard-after-discourse-login/60116/6 "2017-03-29T18:01:20Z")

</div>

It’s possible that there is an issue with the SSO redirect from WordPress to Discourse that occurs after authentication on WordPress. Do you know if you have any other WordPress plugins installed that could be altering the ‘allowed\_redirect\_hosts’?

---

<div class="post-metadata">

### Author: ![Martin\_O](https://avatars.discourse-cdn.com/v4/letter/m/ea666f/32.png) [@Martin\_O](https://meta.discourse.org/u/Martin_O)
#### Post date: [30 maart 2017 om 11:28 UTC](https://meta.discourse.org/t/redirected-to-wordpress-dashboard-after-discourse-login/60116/7 "2017-03-30T11:28:47Z")

</div>

Simon, thanks for advice.

Temporarily solved by adding our discourse host to the hosts array in allow\_discourse\_redirect function manually.  
Would it be of use to add this list of hosts to the [Discourse sso](https://meta.discourse.org/t/13045?silent=true) configuration in wp Dashboard?

---

<div class="post-metadata">

### Author: ![simon](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/simon/32/339122_2.png) [@simon](https://meta.discourse.org/u/simon)
#### Post date: [30 maart 2017 om 15:18 UTC](https://meta.discourse.org/t/redirected-to-wordpress-dashboard-after-discourse-login/60116/8 "2017-03-30T15:18:41Z")

</div>

> [@Martin\_O](#):
>
> Would it be of use to add this list of hosts to the [Discourse sso](https://meta.discourse.org/t/13045?silent=true) configuration in wp Dashboard?

From what I understand about your setup, you have two URLs pointing at your forum, with the first one redirecting to the second one. I’m not sure if an option should be added to the plugin for dealing with that situation.

For now, instead of editing the plugin’s code, you can add to the allowed hosts array in your theme’s `functions.php` file by doing something like this:

```php
function your_namespace_allow_extra_redirect( $hosts ) {

	$hosts[] = 'yourseconddomain.com';

return $hosts;
}
add_filter( 'allowed_redirect_hosts', 'your_namespace_allow_extra_redirect' );

```
