From 064b2879adc8e49da49960320ee46095e55cf736 Mon Sep 17 00:00:00 2001 From: Sarah Vaupel Date: Thu, 16 May 2024 17:01:25 +0200 Subject: [PATCH] fix(oauth2): use azureadv2 instead of v1 plugin --- src/Application.hs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Application.hs b/src/Application.hs index fbf55b8aa..e9874d3c1 100644 --- a/src/Application.hs +++ b/src/Application.hs @@ -101,7 +101,7 @@ import UnliftIO.Pool import qualified Web.ServerSession.Backend.Acid as Acid import Web.ServerSession.Core (StorageException(..)) -import Yesod.Auth.OAuth2.AzureAD (oauth2AzureADScoped) +import Yesod.Auth.OAuth2.AzureADv2 (oauth2AzureADv2Scoped) import Yesod.Auth.Util.PasswordStore import qualified Yesod.Core.Types as Yesod (Logger(..)) @@ -328,7 +328,7 @@ makeFoundation appSettings''@AppSettings{..} = do #ifdef DEVELOPMENT oauth2Plugins <- liftIO $ sequence [ (azureMockServer . fromJust) <$> lookupEnv "OAUTH2_SERVER_PORT" - , return $ oauth2AzureADScoped ["openid", "profile", "offline_access"] "42" "shhh" + , return $ oauth2AzureADv2Scoped ["openid", "profile", "offline_access"] "42" "shhh" ] #else let -- Auth Plugins @@ -345,7 +345,7 @@ makeFoundation appSettings''@AppSettings{..} = do -- -> error "Tenant ID missing!" oauth2Plugins | UserAuthConfSingleSource (AuthSourceConfAzureAdV2 AzureConf{..}) <- appUserAuthConf - = singleton $ oauth2AzureADScoped (Set.toList azureConfScopes) (tshow azureConfClientId) azureConfClientSecret + = singleton $ oauth2AzureADv2Scoped (Set.toList azureConfScopes) (tshow azureConfClientId) azureConfClientSecret | otherwise = mempty #endif