# Logging in discourse using API - using discourse as API server only

**URL:** <https://meta.discourse.org/t/logging-in-discourse-using-api-using-discourse-as-api-server-only/68938>\
**Category:** Development\
**Created:** [August 28, 2017, 4:00pm UTC](https://meta.discourse.org/t/logging-in-discourse-using-api-using-discourse-as-api-server-only/68938 "2017-08-28T16:00:17Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![maggiomj](https://avatars.discourse-cdn.com/v4/letter/m/bb73d2/32.png) [@maggiomj](https://meta.discourse.org/u/maggiomj)\
**Post date:** [June 24, 2019, 4:01pm UTC](https://meta.discourse.org/t/logging-in-discourse-using-api-using-discourse-as-api-server-only/68938/4 "2019-06-24T16:01:31Z")

</div>

Hello,

I’m heading down a similar path and stumbled across this topic. I’m curious how this would work in conjunction with SSO (we are trying to embed messaging into our existing SPA). Is an approach (post authentication in our app):

- sso login the user (to ensure they are in discourse, though would using sso\_sync, ahead of time or on-the-fly make sense instead?)
- call APIs where we “just specify `api_username` when you make your API calls with the master id”

Apologies in advance if there are other, more up-to-date topics on this

---

_[View the full topic](https://meta.discourse.org/t/logging-in-discourse-using-api-using-discourse-as-api-server-only/68938)._
