# Discourse Connect: How implementing Discourse login with an existing database?

**URL:** https://meta.discourse.org/t/discourse-connect-how-implementing-discourse-login-with-an-existing-database/197352
**Category:** Support
**Created:** [July 16, 2021, 12:32pm UTC](https://meta.discourse.org/t/discourse-connect-how-implementing-discourse-login-with-an-existing-database/197352 "2021-07-16T12:32:03Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![Francesco\_Bagnoli](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/francesco_bagnoli/32/223162_2.png) [@Francesco\_Bagnoli](https://meta.discourse.org/u/Francesco_Bagnoli)
#### Post date: [July 16, 2021, 12:32pm UTC](https://meta.discourse.org/t/discourse-connect-how-implementing-discourse-login-with-an-existing-database/197352/1 "2021-07-16T12:32:03Z")

</div>

Hi, I have a database with username and password and I want use [DiscourseConnect](https://meta.discourse.org/t/discourseconnect-official-single-sign-on-for-discourse-sso/13045) for use existing users account on Discourse forum.

I don’t understand how retrieve the email and the password that user input info the login form of Discourse.

Into my sso endpoint I receive the query parameters: `?sso=XXX&sig=XXX`

But i need to receive username and password for check into the db…

---

<div class="post-metadata">

### Author: ![Falco](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/falco/32/179432_2.png) [@Falco](https://meta.discourse.org/u/Falco)
#### Post date: [July 16, 2021, 1:03pm UTC](https://meta.discourse.org/t/discourse-connect-how-implementing-discourse-login-with-an-existing-database/197352/2 "2021-07-16T13:03:17Z")

</div>

You will need to create a small web service that connects to that database, and when receives a redirect with those parameters prompts the user for username and password and then redirects the user back to Discourse.

---

<div class="post-metadata">

### Author: ![Francesco\_Bagnoli](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/francesco_bagnoli/32/223162_2.png) [@Francesco\_Bagnoli](https://meta.discourse.org/u/Francesco_Bagnoli)
#### Post date: [July 16, 2021, 1:58pm UTC](https://meta.discourse.org/t/discourse-connect-how-implementing-discourse-login-with-an-existing-database/197352/3 "2021-07-16T13:58:40Z")

</div>

Ok, this means, when discourse redirect to my web service i show a login page? I thinked discourse use his login, and redirect to me after user press on login button

---

<div class="post-metadata">

### Author: ![Falco](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/falco/32/179432_2.png) [@Falco](https://meta.discourse.org/u/Falco)
#### Post date: [July 16, 2021, 2:48pm UTC](https://meta.discourse.org/t/discourse-connect-how-implementing-discourse-login-with-an-existing-database/197352/4 "2021-07-16T14:48:09Z")

</div>

> [@Francesco\_Bagnoli](#):
>
> Ok, this means, when discourse redirect to my web service i show a login page?

Yes!

> [@Francesco\_Bagnoli](#):
>
> I thinked discourse use his login, and redirect to me after user press on login button

When using [DiscourseConnect](https://meta.discourse.org/t/13045?silent=true) we will just redirect every user login to a service you own, so you have 100% control over the whole signup, login, password requirement, group membership, etc.

---

<div class="post-metadata">

### Author: ![Francesco\_Bagnoli](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/francesco_bagnoli/32/223162_2.png) [@Francesco\_Bagnoli](https://meta.discourse.org/u/Francesco_Bagnoli)
#### Post date: [July 16, 2021, 3:18pm UTC](https://meta.discourse.org/t/discourse-connect-how-implementing-discourse-login-with-an-existing-database/197352/5 "2021-07-16T15:18:11Z")

</div>

Ok! now I have undestod! 😀
