@azure/functions-authentication-events 1.0.0-beta.2 → 1.0.0-beta.3
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.
- package/LICENSE +3 -3
- package/README.md +125 -117
- package/dist/browser/constants.d.ts +2 -0
- package/dist/browser/constants.d.ts.map +1 -0
- package/{dist-esm/src → dist/browser}/constants.js +1 -1
- package/{dist-esm/src → dist/browser}/constants.js.map +1 -1
- package/dist/browser/events.d.ts +87 -0
- package/dist/browser/events.d.ts.map +1 -0
- package/{dist-esm/src → dist/browser}/events.js +1 -1
- package/dist/browser/events.js.map +1 -0
- package/dist/browser/index.d.ts +5 -0
- package/dist/browser/index.d.ts.map +1 -0
- package/dist/browser/index.js +5 -0
- package/dist/browser/index.js.map +1 -0
- package/dist/browser/logger.d.ts +7 -0
- package/dist/browser/logger.d.ts.map +1 -0
- package/{dist-esm/src → dist/browser}/logger.js +1 -1
- package/{dist-esm/src → dist/browser}/logger.js.map +1 -1
- package/dist/browser/package.json +3 -0
- package/dist/browser/tokenIssuanceStart/actions.d.ts +17 -0
- package/dist/browser/tokenIssuanceStart/actions.d.ts.map +1 -0
- package/{dist-esm/src → dist/browser}/tokenIssuanceStart/actions.js +1 -1
- package/dist/browser/tokenIssuanceStart/actions.js.map +1 -0
- package/dist/browser/tokenIssuanceStart/context.d.ts +105 -0
- package/dist/browser/tokenIssuanceStart/context.d.ts.map +1 -0
- package/dist/browser/tokenIssuanceStart/context.js +4 -0
- package/dist/browser/tokenIssuanceStart/context.js.map +1 -0
- package/dist/browser/tokenIssuanceStart/index.d.ts +3 -0
- package/dist/browser/tokenIssuanceStart/index.d.ts.map +1 -0
- package/dist/browser/tokenIssuanceStart/index.js +4 -0
- package/{dist-esm/src → dist/browser}/tokenIssuanceStart/index.js.map +1 -1
- package/dist/commonjs/constants.d.ts +2 -0
- package/dist/commonjs/constants.d.ts.map +1 -0
- package/dist/commonjs/constants.js +7 -0
- package/dist/commonjs/constants.js.map +1 -0
- package/dist/commonjs/events.d.ts +87 -0
- package/dist/commonjs/events.d.ts.map +1 -0
- package/dist/commonjs/events.js +17 -0
- package/dist/commonjs/events.js.map +1 -0
- package/dist/commonjs/index.d.ts +5 -0
- package/dist/commonjs/index.d.ts.map +1 -0
- package/dist/commonjs/index.js +10 -0
- package/dist/commonjs/index.js.map +1 -0
- package/dist/commonjs/logger.d.ts +7 -0
- package/dist/commonjs/logger.d.ts.map +1 -0
- package/dist/commonjs/logger.js +13 -0
- package/dist/commonjs/logger.js.map +1 -0
- package/dist/commonjs/package.json +3 -0
- package/dist/commonjs/tokenIssuanceStart/actions.d.ts +17 -0
- package/dist/commonjs/tokenIssuanceStart/actions.d.ts.map +1 -0
- package/dist/commonjs/tokenIssuanceStart/actions.js +13 -0
- package/dist/commonjs/tokenIssuanceStart/actions.js.map +1 -0
- package/dist/commonjs/tokenIssuanceStart/context.d.ts +105 -0
- package/dist/commonjs/tokenIssuanceStart/context.d.ts.map +1 -0
- package/dist/commonjs/tokenIssuanceStart/context.js +5 -0
- package/dist/commonjs/tokenIssuanceStart/context.js.map +1 -0
- package/dist/commonjs/tokenIssuanceStart/index.d.ts +3 -0
- package/dist/commonjs/tokenIssuanceStart/index.d.ts.map +1 -0
- package/dist/commonjs/tokenIssuanceStart/index.js +8 -0
- package/dist/commonjs/tokenIssuanceStart/index.js.map +1 -0
- package/{types/latest → dist/commonjs}/tsdoc-metadata.json +11 -11
- package/dist/esm/constants.d.ts +2 -0
- package/dist/esm/constants.d.ts.map +1 -0
- package/dist/esm/constants.js +4 -0
- package/dist/esm/constants.js.map +1 -0
- package/dist/esm/events.d.ts +87 -0
- package/dist/esm/events.d.ts.map +1 -0
- package/dist/esm/events.js +14 -0
- package/dist/esm/events.js.map +1 -0
- package/dist/esm/index.d.ts +5 -0
- package/dist/esm/index.d.ts.map +1 -0
- package/dist/esm/index.js +5 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/logger.d.ts +7 -0
- package/dist/esm/logger.d.ts.map +1 -0
- package/dist/esm/logger.js +10 -0
- package/dist/esm/logger.js.map +1 -0
- package/dist/esm/package.json +3 -0
- package/dist/esm/tokenIssuanceStart/actions.d.ts +17 -0
- package/dist/esm/tokenIssuanceStart/actions.d.ts.map +1 -0
- package/dist/esm/tokenIssuanceStart/actions.js +10 -0
- package/dist/esm/tokenIssuanceStart/actions.js.map +1 -0
- package/dist/esm/tokenIssuanceStart/context.d.ts +105 -0
- package/dist/esm/tokenIssuanceStart/context.d.ts.map +1 -0
- package/dist/esm/tokenIssuanceStart/context.js +4 -0
- package/dist/esm/tokenIssuanceStart/context.js.map +1 -0
- package/dist/esm/tokenIssuanceStart/index.d.ts +3 -0
- package/dist/esm/tokenIssuanceStart/index.d.ts.map +1 -0
- package/dist/esm/tokenIssuanceStart/index.js +4 -0
- package/dist/esm/tokenIssuanceStart/index.js.map +1 -0
- package/dist/react-native/constants.d.ts +2 -0
- package/dist/react-native/constants.d.ts.map +1 -0
- package/dist/react-native/constants.js +4 -0
- package/dist/react-native/constants.js.map +1 -0
- package/dist/react-native/events.d.ts +87 -0
- package/dist/react-native/events.d.ts.map +1 -0
- package/dist/react-native/events.js +14 -0
- package/dist/react-native/events.js.map +1 -0
- package/dist/react-native/index.d.ts +5 -0
- package/dist/react-native/index.d.ts.map +1 -0
- package/dist/react-native/index.js +5 -0
- package/dist/react-native/index.js.map +1 -0
- package/dist/react-native/logger.d.ts +7 -0
- package/dist/react-native/logger.d.ts.map +1 -0
- package/dist/react-native/logger.js +10 -0
- package/dist/react-native/logger.js.map +1 -0
- package/dist/react-native/package.json +3 -0
- package/dist/react-native/tokenIssuanceStart/actions.d.ts +17 -0
- package/dist/react-native/tokenIssuanceStart/actions.d.ts.map +1 -0
- package/dist/react-native/tokenIssuanceStart/actions.js +10 -0
- package/dist/react-native/tokenIssuanceStart/actions.js.map +1 -0
- package/dist/react-native/tokenIssuanceStart/context.d.ts +105 -0
- package/dist/react-native/tokenIssuanceStart/context.d.ts.map +1 -0
- package/dist/react-native/tokenIssuanceStart/context.js +4 -0
- package/dist/react-native/tokenIssuanceStart/context.js.map +1 -0
- package/dist/react-native/tokenIssuanceStart/index.d.ts +3 -0
- package/dist/react-native/tokenIssuanceStart/index.d.ts.map +1 -0
- package/dist/react-native/tokenIssuanceStart/index.js +4 -0
- package/dist/react-native/tokenIssuanceStart/index.js.map +1 -0
- package/package.json +84 -79
- package/dist/index.js +0 -31
- package/dist/index.js.map +0 -1
- package/dist-esm/src/events.js.map +0 -1
- package/dist-esm/src/index.js +0 -5
- package/dist-esm/src/index.js.map +0 -1
- package/dist-esm/src/tokenIssuanceStart/actions.js.map +0 -1
- package/dist-esm/src/tokenIssuanceStart/context.js +0 -4
- package/dist-esm/src/tokenIssuanceStart/context.js.map +0 -1
- package/dist-esm/src/tokenIssuanceStart/index.js +0 -4
- package/types/3.1/functions-authentication-events.d.ts +0 -202
- package/types/latest/functions-authentication-events.d.ts +0 -224
package/LICENSE
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
Copyright (c) Microsoft Corporation.
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
MIT License
|
|
4
4
|
|
|
5
5
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
6
|
of this software and associated documentation files (the "Software"), to deal
|
|
@@ -12,7 +12,7 @@ furnished to do so, subject to the following conditions:
|
|
|
12
12
|
The above copyright notice and this permission notice shall be included in all
|
|
13
13
|
copies or substantial portions of the Software.
|
|
14
14
|
|
|
15
|
-
THE SOFTWARE IS PROVIDED
|
|
15
|
+
THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
16
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
17
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
18
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
package/README.md
CHANGED
|
@@ -4,42 +4,42 @@ Authentication Event Trigger for Azure Functions handles all the backend process
|
|
|
4
4
|
|
|
5
5
|
This project framework provides the following features:
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
7
|
+
- Token validation for securing the API call
|
|
8
|
+
- Object model, typing, and IDE intellisense
|
|
9
|
+
- Inbound and outbound validation of the API request and response schemas
|
|
10
|
+
- Versioning
|
|
11
|
+
- No need for boilerplate code.
|
|
12
12
|
|
|
13
13
|
## Getting started
|
|
14
14
|
|
|
15
15
|
### Install the npm package
|
|
16
16
|
|
|
17
17
|
```console
|
|
18
|
-
npm install @azure/functions-authentication-events
|
|
18
|
+
npm install @azure/functions-authentication-events
|
|
19
19
|
```
|
|
20
20
|
|
|
21
21
|
### Prerequisites
|
|
22
22
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
23
|
+
- [Azure function tools](https://github.com/Azure/azure-functions-core-tools)
|
|
24
|
+
- [Azure Function Core Tools](https://github.com/Azure/azure-functions-core-tools#installing)
|
|
25
|
+
- If using Visual Studio Code the following extensions:
|
|
26
|
+
- [ms-azuretools.vscode-azurefunctions](https://marketplace.visualstudio.com/items?itemName=ms-azuretools.vscode-azurefunctions)
|
|
27
|
+
- [ms-dotnettools.csharp](https://marketplace.visualstudio.com/items?itemName=ms-dotnettools.csharp)
|
|
28
28
|
|
|
29
29
|
### Authenticate the Client
|
|
30
30
|
|
|
31
|
-
When Azure AD authentication events service calls your custom extension, it will send an `Authorization` header with a `Bearer {token}`. This token will represent a [service to service authentication](https://review.
|
|
31
|
+
When Azure AD authentication events service calls your custom extension, it will send an `Authorization` header with a `Bearer {token}`. This token will represent a [service to service authentication](https://review.learn.microsoft.com/azure/active-directory/develop/v2-oauth2-client-creds-grant-flow) in which:
|
|
32
32
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
33
|
+
- The '**resource**', also known as the **audience**, is the application that you register to represent your API. This is represented by the `aud` claim in the token.
|
|
34
|
+
- The '**client**' is a Microsoft application that represents the Azure AD authentication events service. It has an `appId` value of `99045fe1-7639-4a75-9d4a-577b6ca3810f`. This is represented by:
|
|
35
|
+
- The `azp` claim in the token if your application `accessTokenAcceptedVersion` property is set to `2`.
|
|
36
|
+
- The `appid` claim in the token if your resource application's `accessTokenAcceptedVersion` property is set to `1` or `null`.
|
|
37
37
|
|
|
38
|
-
There are three approaches to dealing with the token. You can customize the behavior using [application settings](https://
|
|
38
|
+
There are three approaches to dealing with the token. You can customize the behavior using [application settings](https://learn.microsoft.com/azure/azure-functions/functions-how-to-use-azure-function-app-settings?tabs=portal#settings) as shown below or via the [local.settings.json](https://learn.microsoft.com/azure/azure-functions/functions-develop-local#local-settings-file) file in local environments.
|
|
39
39
|
|
|
40
40
|
#### Validate tokens using Azure Functions Azure AD authentication integration
|
|
41
41
|
|
|
42
|
-
When running your function in production, it is **highly recommended** to use the [Azure Functions Azure AD authentication integration](https://
|
|
42
|
+
When running your function in production, it is **highly recommended** to use the [Azure Functions Azure AD authentication integration](https://learn.microsoft.com/azure/app-service/configure-authentication-provider-aad#-option-2-use-an-existing-registration-created-separately) for validating incoming tokens.
|
|
43
43
|
|
|
44
44
|
1. Go to the "Authentication" tab in your Function App
|
|
45
45
|
2. Click on "Add identity provider"
|
|
@@ -47,29 +47,27 @@ When running your function in production, it is **highly recommended** to use th
|
|
|
47
47
|
4. Select "Provide the details of an existing app registration"
|
|
48
48
|
5. Enter the `Application ID` of the app that represents your API in Azure AD
|
|
49
49
|
|
|
50
|
-
The issuer and allowed audience depends on the [`accessTokenAcceptedVersion`](https://review.
|
|
50
|
+
The issuer and allowed audience depends on the [`accessTokenAcceptedVersion`](https://review.learn.microsoft.com/azure/active-directory/develop/access-tokens) property of your application (can be found in the "Manifest" of the application).
|
|
51
51
|
|
|
52
|
-
If the `accessTokenAcceptedVersion` property is set to `2`:
|
|
53
|
-
6. Set the `Issuer URL to "https://login.microsoftonline.com/{tenantId}/v2.0"
|
|
52
|
+
If the `accessTokenAcceptedVersion` property is set to `2`: 6. Set the `Issuer URL to "https://login.microsoftonline.com/{tenantId}/v2.0"
|
|
54
53
|
7. Set an 'Allowed Audience' to the Application ID (`appId`)
|
|
55
54
|
|
|
56
|
-
If the `accessTokenAcceptedVersion` property is set to `1` or `null`:
|
|
57
|
-
|
|
58
|
-
7. Set an 'Allowed Audience' to the Application ID URI (also known as`identifierUri`). It should be in the format of`api://{azureFunctionAppName}.azurewebsites.net/{resourceApiAppId}` or `api://{FunctionAppFullyQualifiedDomainName}/{resourceApiAppId}` if using a [custom domain name](https://docs.microsoft.com/azure/dns/dns-custom-domain#:~:text=Azure%20Function%20App%201%20Navigate%20to%20Function%20App,Custom%20domain%20text%20field%20and%20select%20Validate.%20).
|
|
55
|
+
If the `accessTokenAcceptedVersion` property is set to `1` or `null`: 6. Set the `Issuer URL to "https://sts.windows.net/{tenantId}/"
|
|
56
|
+
7. Set an 'Allowed Audience' to the Application ID URI (also known as`identifierUri`). It should be in the format of`api://{azureFunctionAppName}.azurewebsites.net/{resourceApiAppId}`or`api://{FunctionAppFullyQualifiedDomainName}/{resourceApiAppId}` if using a [custom domain name](https://learn.microsoft.com/azure/dns/dns-custom-domain#:~:text=Azure%20Function%20App%201%20Navigate%20to%20Function%20App,Custom%20domain%20text%20field%20and%20select%20Validate.%20).
|
|
59
57
|
|
|
60
58
|
By default, the Authentication event trigger will validate that Azure Function authentication integration is configured and it will check that the **client** in the token is set to `99045fe1-7639-4a75-9d4a-577b6ca3810f` (via the `azp` or `appid` claims in the token).
|
|
61
59
|
|
|
62
60
|
If you want to test your API against some other client that is not Azure AD authentication events service, like using Postman, you can configure an _optional_ application setting:
|
|
63
61
|
|
|
64
|
-
|
|
62
|
+
- **AuthenticationEvents\_\_CustomCallerAppId** - the guid of your desired client. If not provided, `99045fe1-7639-4a75-9d4a-577b6ca3810f` is assumed.
|
|
65
63
|
|
|
66
64
|
#### Have the trigger validate the token
|
|
67
65
|
|
|
68
66
|
In local environments or environments that aren't hosted in the Azure Function service, the trigger can do the token validation. Set the following application settings:
|
|
69
67
|
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
68
|
+
- **AuthenticationEvents\_\_TenantId** - your tenant ID
|
|
69
|
+
- **AuthenticationEvents\_\_AudienceAppId** - the same value as "Allowed audience" in option 1.
|
|
70
|
+
- **AuthenticationEvents\_\_CustomCallerAppId** (_optional_) - the guid of your desired client. If not provided, `99045fe1-7639-4a75-9d4a-577b6ca3810f` is assumed.
|
|
73
71
|
|
|
74
72
|
An example `local.settings.json` file:
|
|
75
73
|
|
|
@@ -90,20 +88,20 @@ An example `local.settings.json` file:
|
|
|
90
88
|
|
|
91
89
|
If you would like to _not_ authenticate the token while in local development, set the following application setting:
|
|
92
90
|
|
|
93
|
-
|
|
91
|
+
- **AuthenticationEvents\_\_BypassTokenValidation** - value of `true` will make the trigger not check for a validation of the token.
|
|
94
92
|
|
|
95
93
|
### Quickstart
|
|
96
94
|
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
95
|
+
- Visual Studio Code
|
|
96
|
+
- Start Visual Studio Code
|
|
97
|
+
- Run the terminal command `func init . --worker-runtime node` via the command palette
|
|
98
|
+
- Run the terminal command `func new` via the command palette
|
|
99
|
+
- Follow the project creation prompts
|
|
100
|
+
- Run the terminal command `npm install @azure/functions-authentication-events` via the command palette
|
|
101
|
+
- Run the terminal command `npm install` via the command palette
|
|
102
|
+
- Run the terminal command `npm run-script build` via the command palette
|
|
103
|
+
- For development purpose turn of token validation for testing:
|
|
104
|
+
- Add the **AuthenticationEvents\_\_BypassTokenValidation** application key to the "Values" section in the local.settings.json file and set it's value to **true**. If you do not have a local.settings.json file in your local environment, create one in the root of your Function App.
|
|
107
105
|
|
|
108
106
|
```json
|
|
109
107
|
{
|
|
@@ -116,7 +114,7 @@ If you would like to _not_ authenticate the token while in local development, se
|
|
|
116
114
|
}
|
|
117
115
|
```
|
|
118
116
|
|
|
119
|
-
|
|
117
|
+
- Once the project is loaded, you can run the sample code and you should see the Azure functions developer's application load your end point.
|
|
120
118
|
|
|
121
119
|
## Key concepts
|
|
122
120
|
|
|
@@ -124,100 +122,109 @@ Key concepts of the Azure .NET SDK can be found [here](https://azure.github.io/a
|
|
|
124
122
|
|
|
125
123
|
## Documentation
|
|
126
124
|
|
|
127
|
-
|
|
125
|
+
- One the function has been published, there's some good reading about logging and metrics that can be found [here](https://learn.microsoft.com/azure/azure-functions/functions-monitor-log-analytics?tabs=csharp)
|
|
128
126
|
|
|
129
|
-
|
|
130
|
-
|
|
127
|
+
- For API Documentation, please see the (Link TBD)
|
|
128
|
+
- Once this moves to preview, we except no breaking changes and would be as simple as removing the the nuget source that points to the private preview.
|
|
131
129
|
|
|
132
130
|
## Examples
|
|
133
131
|
|
|
134
132
|
To Test Token Augmentation, please do the following.
|
|
135
133
|
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
134
|
+
- Open the project that was created in the prior step. (QuickStart)
|
|
135
|
+
- Run the Application. `func host start`
|
|
136
|
+
- Once the Azure functions developer's application has started, copy the listening url that is displayed with the application starts up.
|
|
137
|
+
- Note: All Authentication functions are listed, in the case we have one function listener registered called "**OnTokenIssuanceStart**"
|
|
138
|
+
- Your function endpoint will then be a combination of the listening url and function, for example: "http://localhost:7071/runtime/webhooks/AuthenticationEvents?code=(YOUR_CODE)&function=OnTokenIssuanceStart"
|
|
139
|
+
- Post the following payload using something like Postman or Fiddler.
|
|
140
|
+
- Steps for using Postman can be found (Link TBD)
|
|
143
141
|
|
|
144
142
|
```json
|
|
145
143
|
{
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
}
|
|
144
|
+
"type": "microsoft.graph.authenticationEvent.tokenIssuanceStart",
|
|
145
|
+
"source": "/tenants/00000001-0000-0ff1-ce00-000000000000/applications/ef9e995c-efdb-4e76-97a9-8cdfc6e06afc",
|
|
146
|
+
"data": {
|
|
147
|
+
"@odata.type": "microsoft.graph.onTokenIssuanceStartCalloutData",
|
|
148
|
+
"tenantId": "00000001-0000-0ff1-ce00-000000000000",
|
|
149
|
+
"authenticationEventListenerId": "f2390d57-9664-4dde-b625-f0115925e1e2",
|
|
150
|
+
"customAuthenticationExtensionId": "9cc1c1ed-5f04-4fdf-85c0-94a7c6ea819c",
|
|
151
|
+
"authenticationContext": {
|
|
152
|
+
"correlationId": "f4bd1870-b774-4fa5-ba78-e08ac6be14c0",
|
|
153
|
+
"client": {
|
|
154
|
+
"ip": "127.0.0.1",
|
|
155
|
+
"locale": "en-us",
|
|
156
|
+
"market": "en-us"
|
|
157
|
+
},
|
|
158
|
+
"protocol": "OAUTH2.0",
|
|
159
|
+
"clientServicePrincipal": {
|
|
160
|
+
"id": "eedfddb9-304e-4d62-aa83-24700a0bcf0e",
|
|
161
|
+
"appId": "ef9e995c-efdb-4e76-97a9-8cdfc6e06afc",
|
|
162
|
+
"appDisplayName": "",
|
|
163
|
+
"displayName": "Test application"
|
|
164
|
+
},
|
|
165
|
+
"resourceServicePrincipal": {
|
|
166
|
+
"id": "eedfddb9-304e-4d62-aa83-24700a0bcf0e",
|
|
167
|
+
"appId": "ef9e995c-efdb-4e76-97a9-8cdfc6e06afc",
|
|
168
|
+
"appDisplayName": "",
|
|
169
|
+
"displayName": "Test application"
|
|
170
|
+
},
|
|
171
|
+
"user": {
|
|
172
|
+
"companyName": "Evo Sts Test",
|
|
173
|
+
"country": "",
|
|
174
|
+
"id": "69d24544-c420-4721-a4bf-106f2378d9f6",
|
|
175
|
+
"mail": "testadmin@evostsoneboxtest.com",
|
|
176
|
+
"onPremisesSamAccountName": "testadmin",
|
|
177
|
+
"onPremisesSecurityIdentifier": "testadmin",
|
|
178
|
+
"preferredDataLocation": "",
|
|
179
|
+
"userPrincipalName": "testadmin@evostsoneboxtest.com"
|
|
180
|
+
}
|
|
184
181
|
}
|
|
182
|
+
}
|
|
185
183
|
}
|
|
186
184
|
```
|
|
187
185
|
|
|
188
|
-
|
|
186
|
+
- You should see this response:
|
|
189
187
|
|
|
190
188
|
```json
|
|
191
189
|
{
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
"Editor"
|
|
205
|
-
]
|
|
206
|
-
}
|
|
207
|
-
]
|
|
208
|
-
}
|
|
190
|
+
"data": {
|
|
191
|
+
"@odata.type": "microsoft.graph.onTokenIssuanceStartResponseData",
|
|
192
|
+
"actions": [
|
|
193
|
+
{
|
|
194
|
+
"@odata.type": "ProvideClaimsForToken",
|
|
195
|
+
"claims": [
|
|
196
|
+
{
|
|
197
|
+
"DateOfBirth": "01/01/2000"
|
|
198
|
+
},
|
|
199
|
+
{
|
|
200
|
+
"CustomRoles": ["Writer", "Editor"]
|
|
201
|
+
}
|
|
209
202
|
]
|
|
210
|
-
|
|
203
|
+
}
|
|
204
|
+
]
|
|
205
|
+
}
|
|
211
206
|
}
|
|
212
207
|
```
|
|
213
208
|
|
|
214
209
|
## Troubleshooting
|
|
215
210
|
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
211
|
+
- Visual Studio Code
|
|
212
|
+
- If running in Visual Studio Code, you get an error along the lines of the local Azure Storage Emulator is unavailable, you can start the emulator manually.! (Note: Azure Storage emulator is now deprecated and the suggested replacement is [Azurite](https://learn.microsoft.com/azure/storage/common/storage-use-azurite?tabs=visual-studio))
|
|
213
|
+
- If using Visual Studio Code on Mac please use [Azurite](https://learn.microsoft.com/azure/storage/common/storage-use-azurite?tabs=visual-studio)
|
|
214
|
+
- If you see the following error on Windows (it's a bug) when trying to run the created projected.
|
|
215
|
+
- This can be resolved by executing this command in powershell `Set-ExecutionPolicy -ExecutionPolicy Unrestricted -Scope LocalMachine` more info on this can be found [here](https://github.com/Azure/azure-functions-core-tools/issues/1821) and [here](https://learn.microsoft.com/powershell/module/microsoft.powershell.core/about/about_execution_policies?view=powershell-7)
|
|
216
|
+
|
|
217
|
+
### Logging
|
|
218
|
+
|
|
219
|
+
Enabling logging may help uncover useful information about failures. In order to see a log of HTTP requests and responses, set the `AZURE_LOG_LEVEL` environment variable to `info`. Alternatively, logging can be enabled at runtime by calling `setLogLevel` in the `@azure/logger`:
|
|
220
|
+
|
|
221
|
+
```ts snippet:SetLogLevel
|
|
222
|
+
import { setLogLevel } from "@azure/logger";
|
|
223
|
+
|
|
224
|
+
setLogLevel("info");
|
|
225
|
+
```
|
|
226
|
+
|
|
227
|
+
For more detailed instructions on how to enable logs, you can look at the [@azure/logger package docs](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/core/logger).
|
|
221
228
|
|
|
222
229
|
## Next steps
|
|
223
230
|
|
|
@@ -225,11 +232,11 @@ For more information on Azure SDK, please refer to [this website](https://azure.
|
|
|
225
232
|
|
|
226
233
|
## Publish
|
|
227
234
|
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
235
|
+
- Follow the instruction here to create and publish your Azure Application. <https://learn.microsoft.com/azure/azure-functions/functions-develop-vs?tabs=in-process#publish-to-azure>
|
|
236
|
+
- To determine your published posting endpoint, combine the azure function endpoint you created, route to the listener and listener code, the listen code can be found by navigating to your azure function application, selecting "App Keys" and copying the value of AuthenticationEvents_extension.
|
|
237
|
+
- For example: "https://azureautheventstriggerdemo.azurewebsites.net/runtime/webhooks/AuthenticationEvents?code=(AuthenticationEvents_extension_key)&function=OnTokenIssuanceStart"
|
|
238
|
+
- Make sure your production environment has the correct application settings for token authentication.
|
|
239
|
+
- Once again you can test the published function by posting the above payload to the new endpoint.
|
|
233
240
|
|
|
234
241
|
## Contributing
|
|
235
242
|
|
|
@@ -252,6 +259,7 @@ more information see the [Code of Conduct FAQ][coc_faq] or contact
|
|
|
252
259
|
<opencode@microsoft.com> with any additional questions or comments.
|
|
253
260
|
|
|
254
261
|
<!-- LINKS -->
|
|
262
|
+
|
|
255
263
|
[cg]: https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/resourcemanager/Azure.ResourceManager/docs/CONTRIBUTING.md
|
|
256
264
|
[coc]: https://opensource.microsoft.com/codeofconduct/
|
|
257
265
|
[coc_faq]: https://opensource.microsoft.com/codeofconduct/faq/
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../src/constants.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,WAAW,EAAE,MAAuB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../src/constants.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,MAAM,CAAC,MAAM,WAAW,GAAW,cAAc,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../src/constants.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,MAAM,CAAC,MAAM,WAAW,GAAW,cAAc,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nexport const SDK_VERSION: string = \"1.0.0-beta.1\";\n"]}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Abstract base event interface to house common event request attributes.
|
|
3
|
+
*/
|
|
4
|
+
export interface AuthenticationEventRequestCommon {
|
|
5
|
+
/** Related Type */
|
|
6
|
+
type: string;
|
|
7
|
+
/** The status of the current request, see RequestStatus. */
|
|
8
|
+
requestStatus: RequestStatus;
|
|
9
|
+
/** A user friendly message (containing errors), that the authentication event returns. */
|
|
10
|
+
statusMessage: string;
|
|
11
|
+
/** A dictionary of query string parameters */
|
|
12
|
+
queryParameters: Record<string, string>;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Event request interface extended the related response and event data (payload) objects.
|
|
16
|
+
*/
|
|
17
|
+
export interface AuthenticationEventRequest<TResponse extends AuthenticationEventResponse, TData extends AuthenticationEventData> extends AuthenticationEventRequestCommon {
|
|
18
|
+
/** Related IEventResponse */
|
|
19
|
+
response: TResponse;
|
|
20
|
+
/** Related IEventData */
|
|
21
|
+
payload: TData;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Event request interface extended the related response and event data (payload) objects for cloud events.
|
|
25
|
+
*/
|
|
26
|
+
export interface CloudEventRequest<TResponse extends AuthenticationEventResponse, TData extends AuthenticationEventData> extends AuthenticationEventRequest<TResponse, TData> {
|
|
27
|
+
/** Related Source */
|
|
28
|
+
source: string;
|
|
29
|
+
/** Related \@odata.type */
|
|
30
|
+
oDataType: string;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Event response interface that houses attributes returned from the authentication events trigger.
|
|
34
|
+
*/
|
|
35
|
+
export interface AuthenticationEventResponse {
|
|
36
|
+
/** A template of the body of the expected response. */
|
|
37
|
+
body: string;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Event data interface pertaining to the expected payload, this interface houses the common attributes for data events.
|
|
41
|
+
*/
|
|
42
|
+
export interface AuthenticationEventData {
|
|
43
|
+
/** Tenant the request is related to. */
|
|
44
|
+
tenantId: string;
|
|
45
|
+
/** Unique Id for the event. */
|
|
46
|
+
authenticationEventListenerId: string;
|
|
47
|
+
/** The unique internal Id of the registered custom extension. */
|
|
48
|
+
customAuthenticationExtensionId: string;
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* An interface that binds a response that has actions
|
|
52
|
+
*/
|
|
53
|
+
export interface ActionableResponse<TEventAction extends AuthenticationEventAction> extends AuthenticationEventResponse {
|
|
54
|
+
/** Collections of actions pertaining to the event. */
|
|
55
|
+
actions: TEventAction[];
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* An interface for any responses that implement an cloud event payload and has actions on it.
|
|
59
|
+
*/
|
|
60
|
+
export interface ActionableCloudEventResponse<TEventAction extends AuthenticationEventAction> extends ActionableResponse<TEventAction> {
|
|
61
|
+
/** Gets the Cloud Event \@odata.type. */
|
|
62
|
+
oDataType: string;
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* An interface representing an action for an event.
|
|
66
|
+
*/
|
|
67
|
+
export interface AuthenticationEventAction {
|
|
68
|
+
/** Must be overridden, this will be the 'Name' of the action in the JSON. */
|
|
69
|
+
actionType: string;
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* The status of the request.
|
|
73
|
+
*/
|
|
74
|
+
export type RequestStatus = "Failed" | "TokenInvalid" | "Successful";
|
|
75
|
+
/**
|
|
76
|
+
* Return the correctly formatted error
|
|
77
|
+
* */
|
|
78
|
+
export interface FailedRequest extends AuthenticationEventResponse {
|
|
79
|
+
error: string;
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* Helper function to create a files request
|
|
83
|
+
* @param error - string or exception
|
|
84
|
+
* @returns a valid FailedRequest object
|
|
85
|
+
*/
|
|
86
|
+
export declare function createFailedRequest(error: unknown): FailedRequest;
|
|
87
|
+
//# sourceMappingURL=events.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"events.d.ts","sourceRoot":"","sources":["../../src/events.ts"],"names":[],"mappings":"AAGA;;GAEG;AACH,MAAM,WAAW,gCAAgC;IAC/C,mBAAmB;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,4DAA4D;IAC5D,aAAa,EAAE,aAAa,CAAC;IAC7B,0FAA0F;IAC1F,aAAa,EAAE,MAAM,CAAC;IACtB,8CAA8C;IAC9C,eAAe,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACzC;AAED;;GAEG;AACH,MAAM,WAAW,0BAA0B,CACzC,SAAS,SAAS,2BAA2B,EAC7C,KAAK,SAAS,uBAAuB,CACrC,SAAQ,gCAAgC;IACxC,6BAA6B;IAC7B,QAAQ,EAAE,SAAS,CAAC;IACpB,yBAAyB;IACzB,OAAO,EAAE,KAAK,CAAC;CAChB;AAED;;GAEG;AACH,MAAM,WAAW,iBAAiB,CAChC,SAAS,SAAS,2BAA2B,EAC7C,KAAK,SAAS,uBAAuB,CACrC,SAAQ,0BAA0B,CAAC,SAAS,EAAE,KAAK,CAAC;IACpD,qBAAqB;IACrB,MAAM,EAAE,MAAM,CAAC;IACf,2BAA2B;IAC3B,SAAS,EAAE,MAAM,CAAC;CACnB;AAED;;GAEG;AACH,MAAM,WAAW,2BAA2B;IAC1C,uDAAuD;IACvD,IAAI,EAAE,MAAM,CAAC;CACd;AAED;;GAEG;AACH,MAAM,WAAW,uBAAuB;IACtC,wCAAwC;IACxC,QAAQ,EAAE,MAAM,CAAC;IACjB,+BAA+B;IAC/B,6BAA6B,EAAE,MAAM,CAAC;IACtC,iEAAiE;IACjE,+BAA+B,EAAE,MAAM,CAAC;CACzC;AAED;;GAEG;AACH,MAAM,WAAW,kBAAkB,CAAC,YAAY,SAAS,yBAAyB,CAChF,SAAQ,2BAA2B;IACnC,sDAAsD;IACtD,OAAO,EAAE,YAAY,EAAE,CAAC;CACzB;AAED;;GAEG;AACH,MAAM,WAAW,4BAA4B,CAAC,YAAY,SAAS,yBAAyB,CAC1F,SAAQ,kBAAkB,CAAC,YAAY,CAAC;IACxC,yCAAyC;IACzC,SAAS,EAAE,MAAM,CAAC;CACnB;AAED;;GAEG;AACH,MAAM,WAAW,yBAAyB;IACxC,6EAA6E;IAC7E,UAAU,EAAE,MAAM,CAAC;CACpB;AAED;;GAEG;AACH,MAAM,MAAM,aAAa,GAAG,QAAQ,GAAG,cAAc,GAAG,YAAY,CAAC;AAErE;;KAEK;AACL,MAAM,WAAW,aAAc,SAAQ,2BAA2B;IAEhE,KAAK,EAAE,MAAM,CAAC;CACf;AAED;;;;GAIG;AACH,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,OAAO,GAAG,aAAa,CAKjE"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"events.js","sourceRoot":"","sources":["../../src/events.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAqGlC;;;;GAIG;AACH,MAAM,UAAU,mBAAmB,CAAC,KAAc;IAChD,OAAO;QACL,IAAI,EAAE,EAAE;QACR,KAAK,EAAE,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC;KAC9D,CAAC;AACJ,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\n/**\n * Abstract base event interface to house common event request attributes.\n */\nexport interface AuthenticationEventRequestCommon {\n /** Related Type */\n type: string;\n /** The status of the current request, see RequestStatus. */\n requestStatus: RequestStatus;\n /** A user friendly message (containing errors), that the authentication event returns. */\n statusMessage: string;\n /** A dictionary of query string parameters */\n queryParameters: Record<string, string>;\n}\n\n/**\n * Event request interface extended the related response and event data (payload) objects.\n */\nexport interface AuthenticationEventRequest<\n TResponse extends AuthenticationEventResponse,\n TData extends AuthenticationEventData,\n> extends AuthenticationEventRequestCommon {\n /** Related IEventResponse */\n response: TResponse;\n /** Related IEventData */\n payload: TData;\n}\n\n/**\n * Event request interface extended the related response and event data (payload) objects for cloud events.\n */\nexport interface CloudEventRequest<\n TResponse extends AuthenticationEventResponse,\n TData extends AuthenticationEventData,\n> extends AuthenticationEventRequest<TResponse, TData> {\n /** Related Source */\n source: string;\n /** Related \\@odata.type */\n oDataType: string;\n}\n\n/**\n * Event response interface that houses attributes returned from the authentication events trigger.\n */\nexport interface AuthenticationEventResponse {\n /** A template of the body of the expected response. */\n body: string;\n}\n\n/**\n * Event data interface pertaining to the expected payload, this interface houses the common attributes for data events.\n */\nexport interface AuthenticationEventData {\n /** Tenant the request is related to. */\n tenantId: string;\n /** Unique Id for the event. */\n authenticationEventListenerId: string;\n /** The unique internal Id of the registered custom extension. */\n customAuthenticationExtensionId: string;\n}\n\n/**\n * An interface that binds a response that has actions\n */\nexport interface ActionableResponse<TEventAction extends AuthenticationEventAction>\n extends AuthenticationEventResponse {\n /** Collections of actions pertaining to the event. */\n actions: TEventAction[];\n}\n\n/**\n * An interface for any responses that implement an cloud event payload and has actions on it.\n */\nexport interface ActionableCloudEventResponse<TEventAction extends AuthenticationEventAction>\n extends ActionableResponse<TEventAction> {\n /** Gets the Cloud Event \\@odata.type. */\n oDataType: string;\n}\n\n/**\n * An interface representing an action for an event.\n */\nexport interface AuthenticationEventAction {\n /** Must be overridden, this will be the 'Name' of the action in the JSON. */\n actionType: string;\n}\n\n/**\n * The status of the request.\n */\nexport type RequestStatus = \"Failed\" | \"TokenInvalid\" | \"Successful\";\n\n/**\n * Return the correctly formatted error\n * */\nexport interface FailedRequest extends AuthenticationEventResponse {\n //* * The error that caused the request to fail. */\n error: string;\n}\n\n/**\n * Helper function to create a files request\n * @param error - string or exception\n * @returns a valid FailedRequest object\n */\nexport function createFailedRequest(error: unknown): FailedRequest {\n return {\n body: \"\",\n error: error instanceof Error ? error.message : String(error),\n };\n}\n"]}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { FailedRequest, ActionableResponse, AuthenticationEventAction, AuthenticationEventData, AuthenticationEventRequest, AuthenticationEventRequestCommon, AuthenticationEventResponse, RequestStatus, CloudEventRequest, createFailedRequest, ActionableCloudEventResponse, } from "./events.js";
|
|
2
|
+
export { AuthenticationEventContext, AuthenticationEventContextClient, AuthenticationEventContextServicePrincipal, AuthenticationEventContextUser, TokenIssuanceStartData, TokenIssuanceStartRequest, TokenIssuanceStartResponse, } from "./tokenIssuanceStart/context.js";
|
|
3
|
+
export { ProvideClaimsForToken, TokenClaim, createProvideClaimsForToken, } from "./tokenIssuanceStart/actions.js";
|
|
4
|
+
export { TokenIssuanceStartAction } from "./tokenIssuanceStart/context.js";
|
|
5
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,aAAa,EACb,kBAAkB,EAClB,yBAAyB,EACzB,uBAAuB,EACvB,0BAA0B,EAC1B,gCAAgC,EAChC,2BAA2B,EAC3B,aAAa,EACb,iBAAiB,EACjB,mBAAmB,EACnB,4BAA4B,GAC7B,MAAM,aAAa,CAAC;AAErB,OAAO,EACL,0BAA0B,EAC1B,gCAAgC,EAChC,0CAA0C,EAC1C,8BAA8B,EAC9B,sBAAsB,EACtB,yBAAyB,EACzB,0BAA0B,GAC3B,MAAM,iCAAiC,CAAC;AACzC,OAAO,EACL,qBAAqB,EACrB,UAAU,EACV,2BAA2B,GAC5B,MAAM,iCAAiC,CAAC;AAEzC,OAAO,EAAE,wBAAwB,EAAE,MAAM,iCAAiC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EAUL,mBAAmB,GAEpB,MAAM,aAAa,CAAC;AAWrB,OAAO,EAGL,2BAA2B,GAC5B,MAAM,iCAAiC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nexport {\n FailedRequest,\n ActionableResponse,\n AuthenticationEventAction,\n AuthenticationEventData,\n AuthenticationEventRequest,\n AuthenticationEventRequestCommon,\n AuthenticationEventResponse,\n RequestStatus,\n CloudEventRequest,\n createFailedRequest,\n ActionableCloudEventResponse,\n} from \"./events.js\";\n\nexport {\n AuthenticationEventContext,\n AuthenticationEventContextClient,\n AuthenticationEventContextServicePrincipal,\n AuthenticationEventContextUser,\n TokenIssuanceStartData,\n TokenIssuanceStartRequest,\n TokenIssuanceStartResponse,\n} from \"./tokenIssuanceStart/context.js\";\nexport {\n ProvideClaimsForToken,\n TokenClaim,\n createProvideClaimsForToken,\n} from \"./tokenIssuanceStart/actions.js\";\n\nexport { TokenIssuanceStartAction } from \"./tokenIssuanceStart/context.js\";\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../../src/logger.ts"],"names":[],"mappings":"AAKA;;;;GAIG;AACH,eAAO,MAAM,MAAM,qCAAwD,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"logger.js","sourceRoot":"","sources":["../../src/logger.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AAEnD;;;;GAIG;AACH,MAAM,CAAC,MAAM,MAAM,GAAG,kBAAkB,CAAC,iCAAiC,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT
|
|
1
|
+
{"version":3,"file":"logger.js","sourceRoot":"","sources":["../../src/logger.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AAEnD;;;;GAIG;AACH,MAAM,CAAC,MAAM,MAAM,GAAG,kBAAkB,CAAC,iCAAiC,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { createClientLogger } from \"@azure/logger\";\n\n/**\n * The \\@azure/logger configuration for this package.\n *\n * @internal\n */\nexport const logger = createClientLogger(\"functions-authentication-events\");\n"]}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { TokenIssuanceStartAction } from "./context.js";
|
|
2
|
+
/**
|
|
3
|
+
* An Interface for the Provide Claims for token action.
|
|
4
|
+
*/
|
|
5
|
+
export interface ProvideClaimsForToken extends TokenIssuanceStartAction {
|
|
6
|
+
/** The 'Name' of the action in the JSON. */
|
|
7
|
+
actionType: "microsoft.graph.ProvideClaimsForToken";
|
|
8
|
+
/** Collection of claims to add to the token. */
|
|
9
|
+
claims: TokenClaim;
|
|
10
|
+
}
|
|
11
|
+
/** Helper function to create a provider claims for token */
|
|
12
|
+
export declare function createProvideClaimsForToken(claims: TokenClaim): ProvideClaimsForToken;
|
|
13
|
+
/**
|
|
14
|
+
* An type representing a claim.
|
|
15
|
+
*/
|
|
16
|
+
export type TokenClaim = Record<string, string | string[]>;
|
|
17
|
+
//# sourceMappingURL=actions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"actions.d.ts","sourceRoot":"","sources":["../../../src/tokenIssuanceStart/actions.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,cAAc,CAAC;AAE7D;;GAEG;AACH,MAAM,WAAW,qBAAsB,SAAQ,wBAAwB;IACrE,4CAA4C;IAC5C,UAAU,EAAE,uCAAuC,CAAC;IACpD,gDAAgD;IAChD,MAAM,EAAE,UAAU,CAAC;CAEpB;AAED,4DAA4D;AAC5D,wBAAgB,2BAA2B,CAAC,MAAM,EAAE,UAAU,GAAG,qBAAqB,CAKrF;AAED;;GAEG;AACH,MAAM,MAAM,UAAU,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"actions.js","sourceRoot":"","sources":["../../../src/tokenIssuanceStart/actions.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAelC,4DAA4D;AAC5D,MAAM,UAAU,2BAA2B,CAAC,MAAkB;IAC5D,OAAO;QACL,UAAU,EAAE,uCAAuC;QACnD,MAAM,EAAE,MAAM;KACf,CAAC;AACJ,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { TokenIssuanceStartAction } from \"./context.js\";\n\n/**\n * An Interface for the Provide Claims for token action.\n */\nexport interface ProvideClaimsForToken extends TokenIssuanceStartAction {\n /** The 'Name' of the action in the JSON. */\n actionType: \"microsoft.graph.ProvideClaimsForToken\";\n /** Collection of claims to add to the token. */\n claims: TokenClaim;\n /** Helper constructor to easily add claims to the action. */\n}\n\n/** Helper function to create a provider claims for token */\nexport function createProvideClaimsForToken(claims: TokenClaim): ProvideClaimsForToken {\n return {\n actionType: \"microsoft.graph.ProvideClaimsForToken\",\n claims: claims,\n };\n}\n\n/**\n * An type representing a claim.\n */\nexport type TokenClaim = Record<string, string | string[]>;\n"]}
|