# SSO with Wordpress and Discourse as Provider login Flow and logic

**URL:** https://meta.discourse.org/t/sso-with-wordpress-and-discourse-as-provider-login-flow-and-logic/124535
**Category:** WordPress
**Created:** [7월 31, 2019, 7:55오후 UTC](https://meta.discourse.org/t/sso-with-wordpress-and-discourse-as-provider-login-flow-and-logic/124535 "2019-07-31T19:55:05Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![BishopV](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/bishopv/32/185715_2.png) [@BishopV](https://meta.discourse.org/u/BishopV)
#### Post date: [7월 31, 2019, 7:55오후 UTC](https://meta.discourse.org/t/sso-with-wordpress-and-discourse-as-provider-login-flow-and-logic/124535/1 "2019-07-31T19:55:05Z")

</div>

Million thanks @simon was assisted me to setting this , finally i can see [Login with Discourse] at my wordpress page. now i need clear my mind and figure it out the logic and login flow to more convenient my member go to wordpress make payment .

Now My Page Sign in flow like this

Login at wordpress \> select login in with discourse \> discourse login page \> logged in \> redirect back to wordpress website .

 ![57%20AM](https://global.discourse-cdn.com/meta/original/3X/4/0/40d279a6188f311fb7be349c0f90f5c7b6a28788.png)

if i want those setting may i know how ?

1. im already done setting when member Login at wordpress using discourse login but redirect back to wordpress , but how about i want another setting when they Login at discourse using discourse login but redirect back to discourse but backend will automatic logged in at wordpress website too ?

2. Disable all my wordpress original login method only discourse login method.

---

<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: [8월 1, 2019, 5:36오후 UTC](https://meta.discourse.org/t/sso-with-wordpress-and-discourse-as-provider-login-flow-and-logic/124535/2 "2019-08-01T17:36:09Z")

</div>

> [@BishopV](#):
>
> i want another setting when they Login at discourse using discourse login but redirect back to discourse but backend will automatic logged in at wordpress website too

You could add a login link to your Discourse forum similar to this:

```plaintext
<a href="http://example.com/?discourse_sso=1&redirect_to=http://discourse.example.com">Login to WordPress and redirect back to Discourse</a>

```

The link should point to the base URL of your WordPress site. You need to set the `discourse_sso=1` query parameter on the URL. The `redirect_to` parameter should be set to the URL you want to redirect users to.

It is possible to redirect users either to your WordPress site, or to Discourse with the redirect. I think that for most cases, it would be more useful to redirect users to the WordPress site instead of Discourse. For example:

```plaintext
<a href="http://example.com/?discourse_sso=1&redirect_to=http://example.com/shop">Login to WordPress from a Discourse post</a>

```

> [@BishopV](#):
>
> Disable all my wordpress original login method only discourse login method.

This could be done, but you will need to be careful about not locking yourself out of WordPress if anything goes wrong. A possible approach would be to put your WordPress `/wp-login.php` page behind a password that is only know to your WordPress site’s admins.
