@azure/msal-node 2.0.2 → 2.2.0-alpha.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (218) hide show
  1. package/README.md +3 -1
  2. package/dist/cache/ITokenCache.d.ts +15 -15
  3. package/dist/cache/NodeStorage.cjs +401 -401
  4. package/dist/cache/NodeStorage.cjs.map +1 -1
  5. package/dist/cache/NodeStorage.d.ts +182 -182
  6. package/dist/cache/NodeStorage.d.ts.map +1 -1
  7. package/dist/cache/NodeStorage.mjs +401 -401
  8. package/dist/cache/NodeStorage.mjs.map +1 -1
  9. package/dist/cache/TokenCache.cjs +265 -269
  10. package/dist/cache/TokenCache.cjs.map +1 -1
  11. package/dist/cache/TokenCache.d.ts +90 -90
  12. package/dist/cache/TokenCache.d.ts.map +1 -1
  13. package/dist/cache/TokenCache.mjs +266 -270
  14. package/dist/cache/TokenCache.mjs.map +1 -1
  15. package/dist/cache/distributed/DistributedCachePlugin.cjs +26 -26
  16. package/dist/cache/distributed/DistributedCachePlugin.cjs.map +1 -1
  17. package/dist/cache/distributed/DistributedCachePlugin.d.ts +10 -10
  18. package/dist/cache/distributed/DistributedCachePlugin.d.ts.map +1 -1
  19. package/dist/cache/distributed/DistributedCachePlugin.mjs +26 -26
  20. package/dist/cache/distributed/DistributedCachePlugin.mjs.map +1 -1
  21. package/dist/cache/distributed/ICacheClient.d.ts +17 -17
  22. package/dist/cache/distributed/IPartitionManager.d.ts +28 -28
  23. package/dist/cache/serializer/Deserializer.cjs +173 -175
  24. package/dist/cache/serializer/Deserializer.cjs.map +1 -1
  25. package/dist/cache/serializer/Deserializer.d.ts +42 -42
  26. package/dist/cache/serializer/Deserializer.d.ts.map +1 -1
  27. package/dist/cache/serializer/Deserializer.mjs +174 -176
  28. package/dist/cache/serializer/Deserializer.mjs.map +1 -1
  29. package/dist/cache/serializer/Serializer.cjs +134 -134
  30. package/dist/cache/serializer/Serializer.cjs.map +1 -1
  31. package/dist/cache/serializer/Serializer.d.ts +39 -39
  32. package/dist/cache/serializer/Serializer.d.ts.map +1 -1
  33. package/dist/cache/serializer/Serializer.mjs +134 -134
  34. package/dist/cache/serializer/Serializer.mjs.map +1 -1
  35. package/dist/cache/serializer/SerializerTypes.d.ts +101 -101
  36. package/dist/client/ClientApplication.cjs +333 -333
  37. package/dist/client/ClientApplication.cjs.map +1 -1
  38. package/dist/client/ClientApplication.d.ts +142 -142
  39. package/dist/client/ClientApplication.d.ts.map +1 -1
  40. package/dist/client/ClientApplication.mjs +334 -334
  41. package/dist/client/ClientApplication.mjs.map +1 -1
  42. package/dist/client/ClientAssertion.cjs +116 -116
  43. package/dist/client/ClientAssertion.cjs.map +1 -1
  44. package/dist/client/ClientAssertion.d.ts +46 -46
  45. package/dist/client/ClientAssertion.d.ts.map +1 -1
  46. package/dist/client/ClientAssertion.mjs +117 -117
  47. package/dist/client/ClientAssertion.mjs.map +1 -1
  48. package/dist/client/ClientCredentialClient.cjs +189 -168
  49. package/dist/client/ClientCredentialClient.cjs.map +1 -1
  50. package/dist/client/ClientCredentialClient.d.ts +33 -33
  51. package/dist/client/ClientCredentialClient.d.ts.map +1 -1
  52. package/dist/client/ClientCredentialClient.mjs +190 -169
  53. package/dist/client/ClientCredentialClient.mjs.map +1 -1
  54. package/dist/client/ConfidentialClientApplication.cjs +163 -164
  55. package/dist/client/ConfidentialClientApplication.cjs.map +1 -1
  56. package/dist/client/ConfidentialClientApplication.d.ts +58 -58
  57. package/dist/client/ConfidentialClientApplication.d.ts.map +1 -1
  58. package/dist/client/ConfidentialClientApplication.mjs +164 -165
  59. package/dist/client/ConfidentialClientApplication.mjs.map +1 -1
  60. package/dist/client/DeviceCodeClient.cjs +207 -207
  61. package/dist/client/DeviceCodeClient.cjs.map +1 -1
  62. package/dist/client/DeviceCodeClient.d.ts +53 -53
  63. package/dist/client/DeviceCodeClient.d.ts.map +1 -1
  64. package/dist/client/DeviceCodeClient.mjs +208 -208
  65. package/dist/client/DeviceCodeClient.mjs.map +1 -1
  66. package/dist/client/IConfidentialClientApplication.d.ts +39 -39
  67. package/dist/client/IConfidentialClientApplication.d.ts.map +1 -1
  68. package/dist/client/IPublicClientApplication.d.ts +42 -42
  69. package/dist/client/IPublicClientApplication.d.ts.map +1 -1
  70. package/dist/client/OnBehalfOfClient.cjs +203 -204
  71. package/dist/client/OnBehalfOfClient.cjs.map +1 -1
  72. package/dist/client/OnBehalfOfClient.d.ts +47 -47
  73. package/dist/client/OnBehalfOfClient.d.ts.map +1 -1
  74. package/dist/client/OnBehalfOfClient.mjs +204 -205
  75. package/dist/client/OnBehalfOfClient.mjs.map +1 -1
  76. package/dist/client/PublicClientApplication.cjs +229 -175
  77. package/dist/client/PublicClientApplication.cjs.map +1 -1
  78. package/dist/client/PublicClientApplication.d.ts +71 -65
  79. package/dist/client/PublicClientApplication.d.ts.map +1 -1
  80. package/dist/client/PublicClientApplication.mjs +232 -178
  81. package/dist/client/PublicClientApplication.mjs.map +1 -1
  82. package/dist/client/UsernamePasswordClient.cjs +95 -95
  83. package/dist/client/UsernamePasswordClient.cjs.map +1 -1
  84. package/dist/client/UsernamePasswordClient.d.ts +25 -25
  85. package/dist/client/UsernamePasswordClient.d.ts.map +1 -1
  86. package/dist/client/UsernamePasswordClient.mjs +95 -95
  87. package/dist/client/UsernamePasswordClient.mjs.map +1 -1
  88. package/dist/config/Configuration.cjs +72 -72
  89. package/dist/config/Configuration.cjs.map +1 -1
  90. package/dist/config/Configuration.d.ts +107 -107
  91. package/dist/config/Configuration.mjs +72 -72
  92. package/dist/config/Configuration.mjs.map +1 -1
  93. package/dist/crypto/CryptoProvider.cjs +75 -75
  94. package/dist/crypto/CryptoProvider.cjs.map +1 -1
  95. package/dist/crypto/CryptoProvider.d.ts +52 -52
  96. package/dist/crypto/CryptoProvider.mjs +75 -75
  97. package/dist/crypto/CryptoProvider.mjs.map +1 -1
  98. package/dist/crypto/GuidGenerator.cjs +22 -22
  99. package/dist/crypto/GuidGenerator.cjs.map +1 -1
  100. package/dist/crypto/GuidGenerator.d.ts +14 -14
  101. package/dist/crypto/GuidGenerator.mjs +22 -22
  102. package/dist/crypto/GuidGenerator.mjs.map +1 -1
  103. package/dist/crypto/HashUtils.cjs +13 -13
  104. package/dist/crypto/HashUtils.cjs.map +1 -1
  105. package/dist/crypto/HashUtils.d.ts +8 -8
  106. package/dist/crypto/HashUtils.mjs +13 -13
  107. package/dist/crypto/HashUtils.mjs.map +1 -1
  108. package/dist/crypto/PkceGenerator.cjs +49 -49
  109. package/dist/crypto/PkceGenerator.cjs.map +1 -1
  110. package/dist/crypto/PkceGenerator.d.ts +22 -22
  111. package/dist/crypto/PkceGenerator.mjs +49 -49
  112. package/dist/crypto/PkceGenerator.mjs.map +1 -1
  113. package/dist/error/NodeAuthError.cjs +85 -85
  114. package/dist/error/NodeAuthError.cjs.map +1 -1
  115. package/dist/error/NodeAuthError.d.ts +65 -65
  116. package/dist/error/NodeAuthError.mjs +85 -85
  117. package/dist/error/NodeAuthError.mjs.map +1 -1
  118. package/dist/index.cjs +17 -1
  119. package/dist/index.cjs.map +1 -1
  120. package/dist/index.d.ts +42 -42
  121. package/dist/index.d.ts.map +1 -1
  122. package/dist/index.mjs +2 -2
  123. package/dist/internals.cjs +8 -8
  124. package/dist/internals.cjs.map +1 -1
  125. package/dist/internals.d.ts +6 -6
  126. package/dist/internals.d.ts.map +1 -1
  127. package/dist/internals.mjs +8 -8
  128. package/dist/internals.mjs.map +1 -1
  129. package/dist/network/HttpClient.cjs +277 -276
  130. package/dist/network/HttpClient.cjs.map +1 -1
  131. package/dist/network/HttpClient.d.ts +25 -25
  132. package/dist/network/HttpClient.d.ts.map +1 -1
  133. package/dist/network/HttpClient.mjs +278 -277
  134. package/dist/network/HttpClient.mjs.map +1 -1
  135. package/dist/network/ILoopbackClient.d.ts +10 -10
  136. package/dist/network/LoopbackClient.cjs +75 -84
  137. package/dist/network/LoopbackClient.cjs.map +1 -1
  138. package/dist/network/LoopbackClient.d.ts +21 -21
  139. package/dist/network/LoopbackClient.d.ts.map +1 -1
  140. package/dist/network/LoopbackClient.mjs +77 -86
  141. package/dist/network/LoopbackClient.mjs.map +1 -1
  142. package/dist/packageMetadata.cjs +4 -4
  143. package/dist/packageMetadata.cjs.map +1 -1
  144. package/dist/packageMetadata.d.ts +2 -2
  145. package/dist/packageMetadata.mjs +4 -4
  146. package/dist/packageMetadata.mjs.map +1 -1
  147. package/dist/request/AuthorizationCodeRequest.d.ts +21 -21
  148. package/dist/request/AuthorizationUrlRequest.d.ts +33 -33
  149. package/dist/request/ClientCredentialRequest.d.ts +14 -14
  150. package/dist/request/DeviceCodeRequest.d.ts +15 -15
  151. package/dist/request/InteractiveRequest.d.ts +22 -22
  152. package/dist/request/InteractiveRequest.d.ts.map +1 -1
  153. package/dist/request/OnBehalfOfRequest.d.ts +14 -14
  154. package/dist/request/RefreshTokenRequest.d.ts +17 -17
  155. package/dist/request/SignOutRequest.d.ts +5 -5
  156. package/dist/request/SilentFlowRequest.d.ts +16 -16
  157. package/dist/request/UsernamePasswordRequest.d.ts +19 -19
  158. package/dist/utils/Constants.cjs +80 -90
  159. package/dist/utils/Constants.cjs.map +1 -1
  160. package/dist/utils/Constants.d.ts +86 -96
  161. package/dist/utils/Constants.d.ts.map +1 -1
  162. package/dist/utils/Constants.mjs +81 -90
  163. package/dist/utils/Constants.mjs.map +1 -1
  164. package/dist/utils/EncodingUtils.cjs +44 -44
  165. package/dist/utils/EncodingUtils.cjs.map +1 -1
  166. package/dist/utils/EncodingUtils.d.ts +26 -26
  167. package/dist/utils/EncodingUtils.mjs +44 -44
  168. package/dist/utils/EncodingUtils.mjs.map +1 -1
  169. package/dist/utils/NetworkUtils.cjs +38 -38
  170. package/dist/utils/NetworkUtils.cjs.map +1 -1
  171. package/dist/utils/NetworkUtils.d.ts +5 -5
  172. package/dist/utils/NetworkUtils.mjs +38 -38
  173. package/dist/utils/NetworkUtils.mjs.map +1 -1
  174. package/package.json +8 -5
  175. package/src/cache/ITokenCache.ts +24 -0
  176. package/src/cache/NodeStorage.ts +533 -0
  177. package/src/cache/TokenCache.ts +358 -0
  178. package/src/cache/distributed/DistributedCachePlugin.ts +56 -0
  179. package/src/cache/distributed/ICacheClient.ts +23 -0
  180. package/src/cache/distributed/IPartitionManager.ts +35 -0
  181. package/src/cache/serializer/Deserializer.ts +218 -0
  182. package/src/cache/serializer/Serializer.ts +173 -0
  183. package/src/cache/serializer/SerializerTypes.ts +121 -0
  184. package/src/client/ClientApplication.ts +596 -0
  185. package/src/client/ClientAssertion.ts +165 -0
  186. package/src/client/ClientCredentialClient.ts +346 -0
  187. package/src/client/ConfidentialClientApplication.ts +268 -0
  188. package/src/client/DeviceCodeClient.ts +369 -0
  189. package/src/client/IConfidentialClientApplication.ts +72 -0
  190. package/src/client/IPublicClientApplication.ts +72 -0
  191. package/src/client/OnBehalfOfClient.ts +368 -0
  192. package/src/client/PublicClientApplication.ts +339 -0
  193. package/src/client/UsernamePasswordClient.ts +180 -0
  194. package/src/config/Configuration.ts +201 -0
  195. package/src/crypto/CryptoProvider.ts +98 -0
  196. package/src/crypto/GuidGenerator.ts +28 -0
  197. package/src/crypto/HashUtils.ts +17 -0
  198. package/src/crypto/PkceGenerator.ts +63 -0
  199. package/src/error/NodeAuthError.ts +117 -0
  200. package/src/index.ts +125 -0
  201. package/src/internals.ts +12 -0
  202. package/src/network/HttpClient.ts +425 -0
  203. package/src/network/ILoopbackClient.ts +19 -0
  204. package/src/network/LoopbackClient.ts +110 -0
  205. package/src/packageMetadata.ts +3 -0
  206. package/src/request/AuthorizationCodeRequest.ts +39 -0
  207. package/src/request/AuthorizationUrlRequest.ts +50 -0
  208. package/src/request/ClientCredentialRequest.ts +29 -0
  209. package/src/request/DeviceCodeRequest.ts +34 -0
  210. package/src/request/InteractiveRequest.ts +39 -0
  211. package/src/request/OnBehalfOfRequest.ts +30 -0
  212. package/src/request/RefreshTokenRequest.ts +34 -0
  213. package/src/request/SignOutRequest.ts +11 -0
  214. package/src/request/SilentFlowRequest.ts +32 -0
  215. package/src/request/UsernamePasswordRequest.ts +36 -0
  216. package/src/utils/Constants.ts +103 -0
  217. package/src/utils/EncodingUtils.ts +50 -0
  218. package/src/utils/NetworkUtils.ts +49 -0
@@ -1 +1 @@
1
- {"version":3,"file":"ClientApplication.cjs","sources":["../../src/client/ClientApplication.ts"],"sourcesContent":[null],"names":["buildAppConfiguration","CryptoProvider","Logger","name","version","NodeStorage","TokenCache","ResponseMode","AuthenticationScheme","AuthorizationCodeClient","ApiId","AuthError","RefreshTokenClient","SilentFlowClient","UsernamePasswordClient","NodeAuthError","ClientAuthError","NodeConstants","Constants","StringUtils","OIDC_DEFAULT_SCOPES","ServerTelemetryManager","Authority","AuthorityFactory"],"mappings":";;;;;;;;;;;;;;AAAA;;;AAGG;AAkDH;;;AAGG;MACmB,iBAAiB,CAAA;AAyBnC;;AAEG;AACH,IAAA,WAAA,CAAsB,aAA4B,EAAA;AAC9C,QAAA,IAAI,CAAC,MAAM,GAAGA,mCAAqB,CAAC,aAAa,CAAC,CAAC;AACnD,QAAA,IAAI,CAAC,cAAc,GAAG,IAAIC,6BAAc,EAAE,CAAC;AAC3C,QAAA,IAAI,CAAC,MAAM,GAAG,IAAIC,iBAAM,CACpB,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,aAAa,EAChCC,oBAAI,EACJC,uBAAO,CACV,CAAC;QACF,IAAI,CAAC,OAAO,GAAG,IAAIC,uBAAW,CAC1B,IAAI,CAAC,MAAM,EACX,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,QAAQ,EACzB,IAAI,CAAC,cAAc,CACtB,CAAC;QACF,IAAI,CAAC,UAAU,GAAG,IAAIC,qBAAU,CAC5B,IAAI,CAAC,OAAO,EACZ,IAAI,CAAC,MAAM,EACX,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,WAAW,CAChC,CAAC;KACL;AAED;;;;;;;;AAQG;IACH,MAAM,cAAc,CAAC,OAAgC,EAAA;QACjD,IAAI,CAA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C,CAAC;;QAGpE,MAAM,YAAY,GAAGC,oBAAS,CAAC,iBAAiB,CAC5C,eAAe,EACf,iBAAiB,CACpB,CAAC;AAEF,QAAA,MAAM,gBAAgB,GAAqB;AACvC,YAAA,YAAY,EAAE,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,YAAY;AAC3C,YAAA,gBAAgB,EAAE,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,gBAAgB;AACnD,YAAA,sBAAsB,EAAE,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,sBAAsB;AAC/D,YAAA,iBAAiB,EAAE,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,iBAAiB;YACrD,wBAAwB;AACxB,YAAA,0BAA0B,EACtB,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,0BAA0B;SAClD,CAAC;QAEF,OAAO,MAAMC,2BAAgB,CAAC,wBAAwB,CAClD,YAAY,EACZ,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,aAAa,EAChC,IAAI,CAAC,OAAO,EACZ,gBAAgB,EAChB,IAAI,CAAC,MAAM,CACd,CAAC;KACL;AAED;;AAEG;IACH,UAAU,GAAA;AACN,QAAA,IAAI,CAAC,OAAO,CAAC,KAAK,EAAE,CAAC;KACxB;AACJ;;;;"}
1
+ {"version":3,"file":"ClientApplication.cjs","sources":["../../src/client/ClientApplication.ts"],"sourcesContent":[null],"names":["buildAppConfiguration","Logger","name","version","NodeStorage","TokenCache","ResponseMode","AuthenticationScheme","RefreshTokenClient","ApiId","AuthError"],"mappings":";;;;;;;;;;;;;;AAKA;AA8BA;AAKA;AACA;;AAgBG;AACH;AACI;AACO,uBAAwB,CAAA;AAE/B;;AAEG;AACH,IAAA,WAAU,CAAA,aAAS,EAAA;AACnB,QAAA,IAAA,CAAA,MAAA,GAAAA,mCAAA,CAAA,aAAA,CAAA,CAAA;;AAEG,QAAA,IAAA,CAAA,MAAA,GAAA,IAAAC,iBAAA,CAAA,IAAA,CAAA,MAAA,CAAA,M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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -1,143 +1,143 @@
1
- import { ClientConfiguration, AuthenticationResult, BaseAuthRequest, Logger, ServerTelemetryManager, AzureRegionConfiguration, AzureCloudOptions, AuthorizationCodePayload } from "@azure/msal-common";
2
- import { Configuration, NodeConfiguration } from "../config/Configuration";
3
- import { CryptoProvider } from "../crypto/CryptoProvider";
4
- import { NodeStorage } from "../cache/NodeStorage";
5
- import { TokenCache } from "../cache/TokenCache";
6
- import { ClientAssertion } from "./ClientAssertion";
7
- import { AuthorizationUrlRequest } from "../request/AuthorizationUrlRequest";
8
- import { AuthorizationCodeRequest } from "../request/AuthorizationCodeRequest";
9
- import { RefreshTokenRequest } from "../request/RefreshTokenRequest";
10
- import { SilentFlowRequest } from "../request/SilentFlowRequest";
11
- import { UsernamePasswordRequest } from "../request/UsernamePasswordRequest";
12
- /**
13
- * Base abstract class for all ClientApplications - public and confidential
14
- * @public
15
- */
16
- export declare abstract class ClientApplication {
17
- protected readonly cryptoProvider: CryptoProvider;
18
- private tokenCache;
19
- /**
20
- * Platform storage object
21
- */
22
- protected storage: NodeStorage;
23
- /**
24
- * Logger object to log the application flow
25
- */
26
- protected logger: Logger;
27
- /**
28
- * Platform configuration initialized by the application
29
- */
30
- protected config: NodeConfiguration;
31
- /**
32
- * Client assertion passed by the user for confidential client flows
33
- */
34
- protected clientAssertion: ClientAssertion;
35
- /**
36
- * Client secret passed by the user for confidential client flows
37
- */
38
- protected clientSecret: string;
39
- /**
40
- * Constructor for the ClientApplication
41
- */
42
- protected constructor(configuration: Configuration);
43
- /**
44
- * Creates the URL of the authorization request, letting the user input credentials and consent to the
45
- * application. The URL targets the /authorize endpoint of the authority configured in the
46
- * application object.
47
- *
48
- * Once the user inputs their credentials and consents, the authority will send a response to the redirect URI
49
- * sent in the request and should contain an authorization code, which can then be used to acquire tokens via
50
- * `acquireTokenByCode(AuthorizationCodeRequest)`.
51
- */
52
- getAuthCodeUrl(request: AuthorizationUrlRequest): Promise<string>;
53
- /**
54
- * Acquires a token by exchanging the Authorization Code received from the first step of OAuth2.0
55
- * Authorization Code flow.
56
- *
57
- * `getAuthCodeUrl(AuthorizationCodeUrlRequest)` can be used to create the URL for the first step of OAuth2.0
58
- * Authorization Code flow. Ensure that values for redirectUri and scopes in AuthorizationCodeUrlRequest and
59
- * AuthorizationCodeRequest are the same.
60
- */
61
- acquireTokenByCode(request: AuthorizationCodeRequest, authCodePayLoad?: AuthorizationCodePayload): Promise<AuthenticationResult>;
62
- /**
63
- * Acquires a token by exchanging the refresh token provided for a new set of tokens.
64
- *
65
- * This API is provided only for scenarios where you would like to migrate from ADAL to MSAL. Otherwise, it is
66
- * recommended that you use `acquireTokenSilent()` for silent scenarios. When using `acquireTokenSilent()`, MSAL will
67
- * handle the caching and refreshing of tokens automatically.
68
- */
69
- acquireTokenByRefreshToken(request: RefreshTokenRequest): Promise<AuthenticationResult | null>;
70
- /**
71
- * Acquires a token silently when a user specifies the account the token is requested for.
72
- *
73
- * This API expects the user to provide an account object and looks into the cache to retrieve the token if present.
74
- * There is also an optional "forceRefresh" boolean the user can send to bypass the cache for access_token and id_token.
75
- * In case the refresh_token is expired or not found, an error is thrown
76
- * and the guidance is for the user to call any interactive token acquisition API (eg: `acquireTokenByCode()`).
77
- */
78
- acquireTokenSilent(request: SilentFlowRequest): Promise<AuthenticationResult>;
79
- /**
80
- * Acquires tokens with password grant by exchanging client applications username and password for credentials
81
- *
82
- * The latest OAuth 2.0 Security Best Current Practice disallows the password grant entirely.
83
- * More details on this recommendation at https://tools.ietf.org/html/draft-ietf-oauth-security-topics-13#section-3.4
84
- * Microsoft's documentation and recommendations are at:
85
- * https://docs.microsoft.com/en-us/azure/active-directory/develop/msal-authentication-flows#usernamepassword
86
- *
87
- * @param request - UsenamePasswordRequest
88
- */
89
- acquireTokenByUsernamePassword(request: UsernamePasswordRequest): Promise<AuthenticationResult | null>;
90
- /**
91
- * Gets the token cache for the application.
92
- */
93
- getTokenCache(): TokenCache;
94
- /**
95
- * Validates OIDC state by comparing the user cached state with the state received from the server.
96
- *
97
- * This API is provided for scenarios where you would use OAuth2.0 state parameter to mitigate against
98
- * CSRF attacks.
99
- * For more information about state, visit https://datatracker.ietf.org/doc/html/rfc6819#section-3.6.
100
- * @param state
101
- * @param cachedState
102
- */
103
- protected validateState(state: string, cachedState: string): void;
104
- /**
105
- * Returns the logger instance
106
- */
107
- getLogger(): Logger;
108
- /**
109
- * Replaces the default logger set in configurations with new Logger with new configurations
110
- * @param logger - Logger instance
111
- */
112
- setLogger(logger: Logger): void;
113
- /**
114
- * Builds the common configuration to be passed to the common component based on the platform configurarion
115
- * @param authority - user passed authority in configuration
116
- * @param serverTelemetryManager - initializes servertelemetry if passed
117
- */
118
- protected buildOauthClientConfiguration(authority: string, requestCorrelationId?: string, serverTelemetryManager?: ServerTelemetryManager, azureRegionConfiguration?: AzureRegionConfiguration, azureCloudOptions?: AzureCloudOptions): Promise<ClientConfiguration>;
119
- private getClientAssertion;
120
- /**
121
- * Generates a request with the default scopes & generates a correlationId.
122
- * @param authRequest - BaseAuthRequest for initialization
123
- */
124
- protected initializeBaseRequest(authRequest: Partial<BaseAuthRequest>): Promise<BaseAuthRequest>;
125
- /**
126
- * Initializes the server telemetry payload
127
- * @param apiId - Id for a specific request
128
- * @param correlationId - GUID
129
- * @param forceRefresh - boolean to indicate network call
130
- */
131
- protected initializeServerTelemetryManager(apiId: number, correlationId: string, forceRefresh?: boolean): ServerTelemetryManager;
132
- /**
133
- * Create authority instance. If authority not passed in request, default to authority set on the application
134
- * object. If no authority set in application object, then default to common authority.
135
- * @param authorityString - authority from user configuration
136
- */
137
- private createAuthority;
138
- /**
139
- * Clear the cache
140
- */
141
- clearCache(): void;
142
- }
1
+ import { ClientConfiguration, AuthenticationResult, BaseAuthRequest, Logger, ServerTelemetryManager, AzureRegionConfiguration, AzureCloudOptions, AuthorizationCodePayload } from "@azure/msal-common";
2
+ import { Configuration, NodeConfiguration } from "../config/Configuration.js";
3
+ import { CryptoProvider } from "../crypto/CryptoProvider.js";
4
+ import { NodeStorage } from "../cache/NodeStorage.js";
5
+ import { TokenCache } from "../cache/TokenCache.js";
6
+ import { ClientAssertion } from "./ClientAssertion.js";
7
+ import { AuthorizationUrlRequest } from "../request/AuthorizationUrlRequest.js";
8
+ import { AuthorizationCodeRequest } from "../request/AuthorizationCodeRequest.js";
9
+ import { RefreshTokenRequest } from "../request/RefreshTokenRequest.js";
10
+ import { SilentFlowRequest } from "../request/SilentFlowRequest.js";
11
+ import { UsernamePasswordRequest } from "../request/UsernamePasswordRequest.js";
12
+ /**
13
+ * Base abstract class for all ClientApplications - public and confidential
14
+ * @public
15
+ */
16
+ export declare abstract class ClientApplication {
17
+ protected readonly cryptoProvider: CryptoProvider;
18
+ private tokenCache;
19
+ /**
20
+ * Platform storage object
21
+ */
22
+ protected storage: NodeStorage;
23
+ /**
24
+ * Logger object to log the application flow
25
+ */
26
+ protected logger: Logger;
27
+ /**
28
+ * Platform configuration initialized by the application
29
+ */
30
+ protected config: NodeConfiguration;
31
+ /**
32
+ * Client assertion passed by the user for confidential client flows
33
+ */
34
+ protected clientAssertion: ClientAssertion;
35
+ /**
36
+ * Client secret passed by the user for confidential client flows
37
+ */
38
+ protected clientSecret: string;
39
+ /**
40
+ * Constructor for the ClientApplication
41
+ */
42
+ protected constructor(configuration: Configuration);
43
+ /**
44
+ * Creates the URL of the authorization request, letting the user input credentials and consent to the
45
+ * application. The URL targets the /authorize endpoint of the authority configured in the
46
+ * application object.
47
+ *
48
+ * Once the user inputs their credentials and consents, the authority will send a response to the redirect URI
49
+ * sent in the request and should contain an authorization code, which can then be used to acquire tokens via
50
+ * `acquireTokenByCode(AuthorizationCodeRequest)`.
51
+ */
52
+ getAuthCodeUrl(request: AuthorizationUrlRequest): Promise<string>;
53
+ /**
54
+ * Acquires a token by exchanging the Authorization Code received from the first step of OAuth2.0
55
+ * Authorization Code flow.
56
+ *
57
+ * `getAuthCodeUrl(AuthorizationCodeUrlRequest)` can be used to create the URL for the first step of OAuth2.0
58
+ * Authorization Code flow. Ensure that values for redirectUri and scopes in AuthorizationCodeUrlRequest and
59
+ * AuthorizationCodeRequest are the same.
60
+ */
61
+ acquireTokenByCode(request: AuthorizationCodeRequest, authCodePayLoad?: AuthorizationCodePayload): Promise<AuthenticationResult>;
62
+ /**
63
+ * Acquires a token by exchanging the refresh token provided for a new set of tokens.
64
+ *
65
+ * This API is provided only for scenarios where you would like to migrate from ADAL to MSAL. Otherwise, it is
66
+ * recommended that you use `acquireTokenSilent()` for silent scenarios. When using `acquireTokenSilent()`, MSAL will
67
+ * handle the caching and refreshing of tokens automatically.
68
+ */
69
+ acquireTokenByRefreshToken(request: RefreshTokenRequest): Promise<AuthenticationResult | null>;
70
+ /**
71
+ * Acquires a token silently when a user specifies the account the token is requested for.
72
+ *
73
+ * This API expects the user to provide an account object and looks into the cache to retrieve the token if present.
74
+ * There is also an optional "forceRefresh" boolean the user can send to bypass the cache for access_token and id_token.
75
+ * In case the refresh_token is expired or not found, an error is thrown
76
+ * and the guidance is for the user to call any interactive token acquisition API (eg: `acquireTokenByCode()`).
77
+ */
78
+ acquireTokenSilent(request: SilentFlowRequest): Promise<AuthenticationResult>;
79
+ /**
80
+ * Acquires tokens with password grant by exchanging client applications username and password for credentials
81
+ *
82
+ * The latest OAuth 2.0 Security Best Current Practice disallows the password grant entirely.
83
+ * More details on this recommendation at https://tools.ietf.org/html/draft-ietf-oauth-security-topics-13#section-3.4
84
+ * Microsoft's documentation and recommendations are at:
85
+ * https://docs.microsoft.com/en-us/azure/active-directory/develop/msal-authentication-flows#usernamepassword
86
+ *
87
+ * @param request - UsenamePasswordRequest
88
+ */
89
+ acquireTokenByUsernamePassword(request: UsernamePasswordRequest): Promise<AuthenticationResult | null>;
90
+ /**
91
+ * Gets the token cache for the application.
92
+ */
93
+ getTokenCache(): TokenCache;
94
+ /**
95
+ * Validates OIDC state by comparing the user cached state with the state received from the server.
96
+ *
97
+ * This API is provided for scenarios where you would use OAuth2.0 state parameter to mitigate against
98
+ * CSRF attacks.
99
+ * For more information about state, visit https://datatracker.ietf.org/doc/html/rfc6819#section-3.6.
100
+ * @param state
101
+ * @param cachedState
102
+ */
103
+ protected validateState(state: string, cachedState: string): void;
104
+ /**
105
+ * Returns the logger instance
106
+ */
107
+ getLogger(): Logger;
108
+ /**
109
+ * Replaces the default logger set in configurations with new Logger with new configurations
110
+ * @param logger - Logger instance
111
+ */
112
+ setLogger(logger: Logger): void;
113
+ /**
114
+ * Builds the common configuration to be passed to the common component based on the platform configurarion
115
+ * @param authority - user passed authority in configuration
116
+ * @param serverTelemetryManager - initializes servertelemetry if passed
117
+ */
118
+ protected buildOauthClientConfiguration(authority: string, requestCorrelationId?: string, serverTelemetryManager?: ServerTelemetryManager, azureRegionConfiguration?: AzureRegionConfiguration, azureCloudOptions?: AzureCloudOptions): Promise<ClientConfiguration>;
119
+ private getClientAssertion;
120
+ /**
121
+ * Generates a request with the default scopes & generates a correlationId.
122
+ * @param authRequest - BaseAuthRequest for initialization
123
+ */
124
+ protected initializeBaseRequest(authRequest: Partial<BaseAuthRequest>): Promise<BaseAuthRequest>;
125
+ /**
126
+ * Initializes the server telemetry payload
127
+ * @param apiId - Id for a specific request
128
+ * @param correlationId - GUID
129
+ * @param forceRefresh - boolean to indicate network call
130
+ */
131
+ protected initializeServerTelemetryManager(apiId: number, correlationId: string, forceRefresh?: boolean): ServerTelemetryManager;
132
+ /**
133
+ * Create authority instance. If authority not passed in request, default to authority set on the application
134
+ * object. If no authority set in application object, then default to common authority.
135
+ * @param authorityString - authority from user configuration
136
+ */
137
+ private createAuthority;
138
+ /**
139
+ * Clear the cache
140
+ */
141
+ clearCache(): void;
142
+ }
143
143
  //# sourceMappingURL=ClientApplication.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ClientApplication.d.ts","sourceRoot":"","sources":["../../src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