# Discourse as SSO provider for Prosody

**URL:** https://meta.discourse.org/t/discourse-as-sso-provider-for-prosody/52246
**Category:** SSO
**Created:** [31.Октябрь.2016 00:43:01 UTC](https://meta.discourse.org/t/discourse-as-sso-provider-for-prosody/52246 "2016-10-31T00:43:01Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![bangarang](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/bangarang/32/63023_2.png) [@bangarang](https://meta.discourse.org/u/bangarang)
#### Post date: [31.Октябрь.2016 00:43:01 UTC](https://meta.discourse.org/t/discourse-as-sso-provider-for-prosody/52246/1 "2016-10-31T00:43:01Z")

</div>

I want to use [Prosody](https://prosody.im/) as my xmpp-server in conjunction with Discourse. Users should be able to login to Prosody with their Discourse login within their desired xmpp-client, which will primarily be [Conversations](https://conversations.im/). For web-based clients like Converse.js or Candychat i could implement the [discourse SSO feature](https://meta.discourse.org/t/using-discourse-as-a-sso-provider/32974). But for non-web apps, like Conversations or Gajim, are their any other solutions out there, especially when Discourse and Prosody runnning on the same server?

The only solution i found so far, is to write a [Prosody authentication module](https://modules.prosody.im/type_auth.html) in Lua that simulates a browser request, which was suggested here: [quote=“DeanMarkTaylor, post:9, topic:40584”]  
You could always simply mimic the requests that a browser would make.  
[/quote]

Is there something similar in Lua out there which i could use to start with or other approaches to solve this request?

---

<div class="post-metadata">

### Author: ![jetatomic](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jetatomic/32/42202_2.png) [@jetatomic](https://meta.discourse.org/u/jetatomic)
#### Post date: [12.Январь.2018 08:48:49 UTC](https://meta.discourse.org/t/discourse-as-sso-provider-for-prosody/52246/2 "2018-01-12T08:48:49Z")

</div>

How did this work out?

> <https://gist.github.com/bangarangadang/4c4d50192ec2984cc6341664f5665f7b>
