Skip to content

Commit ce63e16

Browse files
author
Marco Zocca
committed
MSAuth file
1 parent 256b1a1 commit ce63e16

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed

ms-auth/src/MSAuth.hs

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
-- | Functions for implementing Azure AD-based authentication
2+
--
3+
-- Both @Auth Code Grant@ (i.e. with browser client interaction) and @App-only@ (i.e. Client Credentials) authentication flows are supported. The former is useful when a user needs to login and delegate some permissions to the application (i.e. accessing personal data), whereas the second is for server processes and automation accounts.
4+
module MSAuth (
5+
applyDotEnv
6+
-- * A App-only flow (server-to-server)
7+
, Token
8+
, newNoToken
9+
, expireToken
10+
, readToken
11+
, fetchUpdateToken
12+
-- ** Default Azure Credential
13+
, defaultAzureCredential
14+
-- * B Auth code grant flow (interactive)
15+
-- ** OAuth endpoints
16+
, loginEndpoint
17+
, replyEndpoint
18+
-- ** In-memory user session
19+
, Tokens
20+
, newTokens
21+
, UserSub
22+
, lookupUser
23+
, expireUser
24+
, tokensToList
25+
-- * Scotty misc
26+
-- ** Azure App Service
27+
, withAADUser
28+
, Scotty
29+
, Action
30+
) where
31+
32+
import Network.OAuth2.Session
33+
import DotEnv (applyDotEnv)

0 commit comments

Comments
 (0)