This repository was archived by the owner on Feb 11, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 5 files changed +18
-11
lines changed
msal-capacitor-plugin-demo Expand file tree Collapse file tree 5 files changed +18
-11
lines changed Original file line number Diff line number Diff line change @@ -10,7 +10,7 @@ def capacitor_pods
1010 # Automatic Capacitor Pod dependencies, do not delete
1111 pod 'Capacitor' , :path => '../../node_modules/@capacitor/ios'
1212 pod 'CapacitorCordova' , :path => '../../node_modules/@capacitor/ios'
13- pod 'AssimalignMsalCapacitorPlugin' , :path => '../../../ msal-capacitor-plugin'
13+ pod 'AssimalignMsalCapacitorPlugin' , :path => '..\..\..\ msal-capacitor-plugin'
1414 # Do not delete
1515end
1616
Original file line number Diff line number Diff line change @@ -30,8 +30,15 @@ export const useAuthentication = (): IAuthContext => {
3030 scopes : [
3131 'user.read'
3232 ] ,
33+ webOptions : {
34+ cacheLocation : 'sessionStorage' , // Can either be localStorage or sessionStorage or Web App. Default is sessionStorage
35+ storeAuthStateInCookie : true
36+ } ,
3337 iosOptions : {
34- tokenCache : 'sessionStorage' ,
38+ keyShareLocation : 'com.company.cache' , // This is the Keyshare location where credentials are stored for silent login
39+ enableBiometrics : true
40+ } ,
41+ androidOptions : {
3542 enableBiometrics : true
3643 }
3744 } ) )
Original file line number Diff line number Diff line change @@ -49,16 +49,16 @@ public class MsalPlugin: CAPPlugin {
4949 var tokenCache = " "
5050
5151 #if os(iOS)
52- if isoOptions [ " tokenCache " ] == nil {
52+ if isoOptions [ " keyShareLocation " ] == nil {
5353 tokenCache = " com.microsoft.adalcache "
5454 } else {
55- tokenCache = isoOptions [ " tokenCache " ] as! String
55+ tokenCache = isoOptions [ " keyShareLocation " ] as! String
5656 }
5757 #else
58- if isoOptions [ " tokenCache " ] == nil {
58+ if isoOptions [ " keyShareLocation " ] == nil {
5959 tokenCache = " com.microsoft.identity.universalstorage "
6060 } else {
61- tokenCache = isoOptions [ " tokenCache " ] as! String
61+ tokenCache = isoOptions [ " keyShareLocation " ] as! String
6262 }
6363 #endif
6464 clientConfiguration. cacheConfig. keychainSharingGroup = tokenCache
Original file line number Diff line number Diff line change @@ -7,16 +7,16 @@ declare module '@capacitor/core' {
77}
88
99export interface IMsalAndroidPluginOptions {
10-
10+ enableBiometrics ?: boolean ;
1111}
1212
1313export interface IMsalWebPluginOptions {
14- cacheLocation : 'sessionStorage' | 'localStorage' ;
15- storeAuthStateInCookie : boolean ;
14+ cacheLocation ? : 'sessionStorage' | 'localStorage' ;
15+ storeAuthStateInCookie ? : boolean ;
1616}
1717
1818export interface IMsalIosPluginOptions {
19- tokenCache ?: string ;
19+ keyShareLocation ?: string ;
2020 enableBiometrics ?: boolean ;
2121}
2222
Original file line number Diff line number Diff line change @@ -32,7 +32,7 @@ export class MsalPluginWeb extends WebPlugin implements IMsalPlugin {
3232 authority : options . authority
3333 } ,
3434 cache : {
35- cacheLocation : options ?. webOptions ?. cacheLocation ?? "localStorage " ,
35+ cacheLocation : options ?. webOptions ?. cacheLocation ?? "sessionStorage " ,
3636 storeAuthStateInCookie : options ?. webOptions ?. storeAuthStateInCookie ?? true
3737 }
3838 } )
You can’t perform that action at this time.
0 commit comments