feat(auth): added azure & mock server to login widget

This commit is contained in:
David Mosbach 2023-12-03 23:23:44 +00:00
parent 9b9370fed0
commit 44d082f8b9
2 changed files with 12 additions and 4 deletions

View File

@ -326,12 +326,12 @@ makeFoundation appSettings''@AppSettings{..} = do
appPersonalisedSheetFilesSeedKey <- clusterSetting (Proxy :: Proxy 'ClusterPersonalisedSheetFilesSeedKey) `customRunSqlPool` sqlPool
mAzureTenantID <- liftIO $ (fmap Text.pack) <$> lookupEnv "AZURE_ADV2_TENANT_ID"
mAzureTenantID <- liftIO $ (fmap Text.pack) <$> (return $ Just "123") -- lookupEnv "AZURE_ADV2_TENANT_ID"
let -- Auth Plugins
tenantID = fromMaybe (error "Tenant ID mising") mAzureTenantID
loadPlugin p prefix = do -- Loads given YesodAuthPlugin
mID <- (fmap Text.pack) <$> (lookupEnv $ prefix ++ "_CLIENT_ID")
mSecret <- (fmap Text.pack) <$> (lookupEnv $ prefix ++ "_CLIENT_SECRET")
mID <- (fmap Text.pack) <$> (return $ Just "UWX") -- (lookupEnv $ prefix ++ "_CLIENT_ID")
mSecret <- (fmap Text.pack) <$> (return $ Just prefix) -- (lookupEnv $ prefix ++ "_CLIENT_SECRET")
let mArgs = (,) <$> mID <*> mSecret
guard $ isJust mArgs
return . uncurry p $ fromJust mArgs

View File

@ -5,7 +5,15 @@ $#
$# SPDX-License-Identifier: AGPL-3.0-or-later
$forall AuthPlugin{apName, apLogin} <- plugins
$if apName == "LDAP"
$if apName == "azureadv2"
<section>
<h2>Azure
^{apLogin toParent}
$elseif apName == "uniworx_dev"
<section>
<h2>_{MsgDummyLoginTitle}
^{apLogin toParent}
$elseif apName == "LDAP"
<section>
<h2>_{MsgLDAPLoginTitle}
^{apLogin toParent}