# Bevestigen van een correcte gebruikersnaam+wachtwoord combinatie via API?

**URL:** <https://meta.discourse.org/t/confirming-a-correct-user-pass-combination-via-api/165128>\
**Category:** Product Support\
**Created:** [23 september 2020 om 19:03 UTC](https://meta.discourse.org/t/confirming-a-correct-user-pass-combination-via-api/165128 "2020-09-23T19:03:29Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![Richie](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/richie/32/115110_2.png) [@Richie](https://meta.discourse.org/u/Richie)\
**Post date:** [23 september 2020 om 19:03 UTC](https://meta.discourse.org/t/confirming-a-correct-user-pass-combination-via-api/165128/1 "2020-09-23T19:03:29Z")

</div>

Hi everyone,

I need some guidance please on logging people in to a remote web site using their existing Discourse user/pass.

I don’t think I need SSO… here’s why.

First, some background around my existing use case and why I don’t like it.

I currently have a website at [https://www.example.com](https://www.example.com) and it has a login button.

When a user clicks the login button they are asked to enter their existing Discourse username and email address (note: user + email, _NOT_ a password)

I then take these two pieces of information and fire an API `GET` request to:

`"https://mydiscourse.comm/admin/users/list/all.json?email=" + strEmail`

In the headers of this API call that I make, I include the “system” user account name and the associated API key for the system user.

If an email address match is found, I compare the Username they gave me in my form to the Username returned in the API response for that given email address.

If it matches I then consider this user logged in on my site at [https://www.example.com](https://www.example.com)

I built this three or four years ago and it still works fine to this day.

But…

1. It is _very_ confusing for a user to enter a Username + Email address combination in a login form  
– Most people always enter a user+pass  
– Despite massive instructions all over my form, people still naturally get it wrong

2. It’s not secure  
– You only need to know the username + their email address and armed with those two (trivial) pieces of information you can log in to [https://www.example.com](https://www.example.com) “as them” with very little trouble

What I’d like to do is have the user click the Login button on [https://www.example.com](https://www.example.com) and enter their existing Discourse User + Pass (instead of user+email !)

My website at [example.com](http://example.com) would then fire a quick API request over to my Discourse, confirm the supplied user/pass combination is correct and return their existing Discourse user id.

Hope this is making sense 😬

I’ve been all over the API documentation and for the life of me I can’t seem to find a simple “login” endpoint? 🤔

I do not need or want to log people in or out of my Discourse itself, I simply need to confirm their user/pass is correct really.

Any pointers, guidance, links or advice very much welcomed 😊

---

_[View the full topic](https://meta.discourse.org/t/confirming-a-correct-user-pass-combination-via-api/165128)._
