-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Marco Zocca
committed
Jul 1, 2023
1 parent
256b1a1
commit ce63e16
Showing
1 changed file
with
33 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
-- | Functions for implementing Azure AD-based authentication | ||
-- | ||
-- 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. | ||
module MSAuth ( | ||
applyDotEnv | ||
-- * A App-only flow (server-to-server) | ||
, Token | ||
, newNoToken | ||
, expireToken | ||
, readToken | ||
, fetchUpdateToken | ||
-- ** Default Azure Credential | ||
, defaultAzureCredential | ||
-- * B Auth code grant flow (interactive) | ||
-- ** OAuth endpoints | ||
, loginEndpoint | ||
, replyEndpoint | ||
-- ** In-memory user session | ||
, Tokens | ||
, newTokens | ||
, UserSub | ||
, lookupUser | ||
, expireUser | ||
, tokensToList | ||
-- * Scotty misc | ||
-- ** Azure App Service | ||
, withAADUser | ||
, Scotty | ||
, Action | ||
) where | ||
|
||
import Network.OAuth2.Session | ||
import DotEnv (applyDotEnv) |