# Suggestion for improving Integrated Authentication development

**URL:** https://meta.discourse.org/t/suggestion-for-improving-integrated-authentication-development/122869
**Category:** Feature
**Created:** [July 13, 2019, 4:01pm UTC](https://meta.discourse.org/t/suggestion-for-improving-integrated-authentication-development/122869 "2019-07-13T16:01:39Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![hawm](https://avatars.discourse-cdn.com/v4/letter/h/f07891/32.png) [@hawm](https://meta.discourse.org/u/hawm)
#### Post date: [July 13, 2019, 4:01pm UTC](https://meta.discourse.org/t/suggestion-for-improving-integrated-authentication-development/122869/1 "2019-07-13T16:01:39Z")

</div>

> [@Custom account (and notification?) system without emails](https://meta.discourse.org/t/custom-account-and-notification-system-without-emails/96240/8):
>
> In theory that could work, you need to be very careful to disable all email related preferences by default. Just bear in mind that Discourse is architected around the central concept of email = identity so when you choose to violate that assumption, you’re not just swimming upstream swimming_man , you’re roaring upstream in a speedboat speedboat.

> [@How to allow login of user through mobile number?](https://meta.discourse.org/t/how-to-allow-login-of-user-through-mobile-number/21966/17):
>
> Problematic since email is so core to what we do. A user without an email has no way to get notifications from us at all. A user without email has no unique identity since that is how they reset their password.

As [Jeff Atwood](https://meta.discourse.org/u/codinghorror) said, email is the core of Discourse and we shouldn’t or we can’t ignore and bypass it.

But real-world may unruly than our imagining, some platforms are not provided an email address and we also want to integrate it to our Discourse. The [discourse-oauth2-basic](https://meta.discourse.org/t/oauth2-basic-support/33879) solution is

> [@Discourse OAuth2 Basic](https://meta.discourse.org/t/discourse-oauth2-basic/33879/1):
>
> SoundCloud do not provide an email so the user will have to provide and verify this when they sign up the first time on Discourse.

The discourse-oauth2-basic is a general-purpose OAuth2 plugin so didn’t include any feature for a special platform, but when we develop a platform-specific authenticator and don’t provide an email address we may want to integrate the platform notification system instead of the default email notification.

My suggested solution is to build a **fake email address** for unique identity like `platform-prefix + platform-id@yourdiscours.com`, an **email validator** to decide which notification system should be used or some hooks and filters to build **sender** when sending a notification, the default email notification or authenticator implemented. I think it’s a non-invasive implemented for exist architected?

---

<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 13, 2019, 6:10pm UTC](https://meta.discourse.org/t/suggestion-for-improving-integrated-authentication-development/122869/2 "2019-07-13T18:10:16Z")

</div>

> [@hawm](#):
>
> I think it’s a non-invasive implemented for exist architected?

That’s completely doable. For example you can have Steam login (which provides no email), set fake emails in a forked version of the plugin and use native push notifications ( available in Windows, Mac OS, Linux and Android) for all notification needs.

It will always need some custom work to integrate with the specific platform, and at Discourse we have some customers using a setup like that to great success. They are some of the biggest instances out there!

---

<div class="post-metadata">

### Author: ![hawm](https://avatars.discourse-cdn.com/v4/letter/h/f07891/32.png) [@hawm](https://meta.discourse.org/u/hawm)
#### Post date: [July 14, 2019, 2:10am UTC](https://meta.discourse.org/t/suggestion-for-improving-integrated-authentication-development/122869/3 "2019-07-14T02:10:31Z")

</div>

> [@Falco](#):
>
> It will always need some custom work to integrate with the specific platform

Yes, but Discourse seems to send export notification via `Email::Sender` directly by hardcode rather than invoking notification event hook, like `DiscourseEvent`

- [Repository search results · GitHub](https://github.com/discourse/discourse/search?l=Ruby&q=Email%3A%3ASender.new.send)

So how to “redirect” notification to our custom notification system, any public example?
