1
1
<div align =" center " >
2
2
3
- # ` elixir-auth-microsoft `
3
+ < h1 > elixir-auth-microsoft</ h1 >
4
4
5
5
The _ easy_ way to add ** Microsoft ` OAuth ` authentication**
6
6
to your ** ` Elixir ` / ` Phoenix ` ** app.
@@ -19,6 +19,29 @@ Just plug-and-play in **5 mins**.
19
19
20
20
</div >
21
21
22
+ - [ _ Why_ ? 🤷] ( #why- )
23
+ - [ _ What_ ? 💭] ( #what- )
24
+ - [ _ Who_ ? 👥] ( #who- )
25
+ - [ _ How_ ? ✅] ( #how- )
26
+ - [ 1. Add the hex package to ` deps ` 📦] ( #1-add-the-hex-package-to-deps- )
27
+ - [ 2. Create an App Registration in Azure Active Directory 🆕] ( #2-create-an-app-registration-in-azure-active-directory- )
28
+ - [ 3. Export Environment / Application Variables] ( #3-export-environment--application-variables )
29
+ - [ A note on tenants] ( #a-note-on-tenants )
30
+ - [ 4. Add a "Sign in with Microsoft" Button to your App] ( #4-add-a-sign-in-with-microsoft-button-to-your-app )
31
+ - [ 5. Use the Built-in Functions to Authenticate People :shipit:] ( #5-use-the-built-in-functions-to-authenticate-people-shipit )
32
+ - [ 6. Add the ` /auth/microsoft/callback ` to ` router.ex ` ] ( #6-add-the-authmicrosoftcallback-to-routerex )
33
+ - [ 6.1 Give it a try!] ( #61-give-it-a-try )
34
+ - [ 7. Logging the person out] ( #7-logging-the-person-out )
35
+ - [ 7.1 Setting up the post-logout redirect URI] ( #71-setting-up-the-post-logout-redirect-uri )
36
+ - [ 7.2 Add button for person to log out] ( #72-add-button-for-person-to-log-out )
37
+ - [ _ Done_ !] ( #done )
38
+ - [ Testing] ( #testing )
39
+ - [ Complete Working Demo / Example ` Phoenix ` App 🚀] ( #complete-working-demo--example-phoenix-app- )
40
+ - [ Optimised SVG + CSS Button] ( #optimised-svg--css-button )
41
+ - [ Notes 📝] ( #notes- )
42
+ - [ Branding Guidelines] ( #branding-guidelines )
43
+
44
+
22
45
# _ Why_ ? 🤷
23
46
24
47
Following
@@ -403,6 +426,30 @@ Thank you! 🙏
403
426
404
427
<br />
405
428
429
+
430
+ ## Testing
431
+
432
+ If you want pre-defined responses without making real requests
433
+ when testing,
434
+ you can add the following property ` httpoison_mock `
435
+ in your ` test.exs ` configuration file.
436
+
437
+ ``` elixir
438
+ config :elixir_auth_microsoft ,
439
+ httpoison_mock: true
440
+ ```
441
+
442
+ With this setting turned on,
443
+ calls will return successful requests
444
+ with mock data.
445
+
446
+ Of course, you could always a mocking library like
447
+ [ ` mox ` ] ( https://github.com/dashbitco/mox )
448
+ for this.
449
+ But if you want a quick way to test your app with this package,
450
+ this option may be for you!
451
+
452
+
406
453
## Complete Working Demo / Example ` Phoenix ` App 🚀
407
454
408
455
If you get stuck
0 commit comments