Skip to content

Commit d1d2251

Browse files
authored
Merge pull request #41716 from eNeRGy164/improve-code-samples
Improve code samples
2 parents c2c9992 + ae49c09 commit d1d2251

File tree

92 files changed

+224
-223
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

92 files changed

+224
-223
lines changed

articles/active-directory-b2c/active-directory-b2c-reference-customize-ui-custom.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ You can provide as many content pages as you like by crafting HTML5/CSS files as
3939
> [!NOTE]
4040
> For security reasons, the use of JavaScript is currently blocked for customization.
4141
42-
In each of your HTML5/CSS templates, you provide an *anchor* element, which corresponds to the required `<div id=api>` element in the HTML or the content page as illustrate hereafter. Azure AD B2C requires that all content pages have this specific div.
42+
In each of your HTML5/CSS templates, you provide an *anchor* element, which corresponds to the required `<div id="api">` element in the HTML or the content page as illustrate hereafter. Azure AD B2C requires that all content pages have this specific div.
4343

4444
```
4545
<!DOCTYPE html>

articles/active-directory/develop/msal-js-initializing-client-applications.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ For authentication methods with redirect flows (`loginRedirect` and `acquireToke
4343
// Configuration object constructed
4444
const config = {
4545
auth: {
46-
clientId: abcd-ef12-gh34-ikkl-ashdjhlhsdg
46+
clientId: "abcd-ef12-gh34-ikkl-ashdjhlhsdg"
4747
}
4848
}
4949

articles/active-directory/develop/msal-js-pass-custom-state-authentication-request.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ For example:
4949
```javascript
5050
let loginRequest = {
5151
scopes: ["user.read", "user.write"],
52-
state: page_url
52+
state: "page_url"
5353
}
5454

5555
myMSALObj.loginPopup(loginRequest);

articles/active-directory/develop/msal-js-sso.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ By default, MSAL.js uses `sessionStorage` which does not allow the session to be
3737
```javascript
3838
const config = {
3939
auth: {
40-
clientId: abcd-ef12-gh34-ikkl-ashdjhlhsdg
40+
clientId: "abcd-ef12-gh34-ikkl-ashdjhlhsdg"
4141
},
4242
cache: {
4343
cacheLocation: 'localStorage'
@@ -159,7 +159,7 @@ var authContext = new AuthenticationContext(config);
159159
// In latest MSAL.js version
160160
const config = {
161161
auth: {
162-
clientId: abcd-ef12-gh34-ikkl-ashdjhlhsdg
162+
clientId: "abcd-ef12-gh34-ikkl-ashdjhlhsdg"
163163
},
164164
cache: {
165165
cacheLocation: 'localStorage'

articles/active-directory/develop/msal-logging.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ function loggerCallback(logLevel, message, containsPii) {
135135

136136
var msalConfig = {
137137
auth: {
138-
clientId: <Enter your client id>,
138+
clientId: "<Enter your client id>",
139139
},
140140
system: {
141141
logger: new Msal.Logger(

articles/active-directory/develop/msal-net-migration.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ MSAL.NET has more explicit exceptions. For example, when silent authentication f
8181
```csharp
8282
catch(AdalException exception)
8383
{
84-
if (exception.ErrorCode == user_interaction_required)
84+
if (exception.ErrorCode == "user_interaction_required")
8585
{
8686
try
8787
{“try to authenticate interactively”}}
@@ -180,7 +180,7 @@ If you want to read and write with MSAL.NET Azure Active Directory using the AAD
180180

181181
```csharp
182182
ResourceId = "https://graph.windows.net/";
183-
var scopes = new [] { ResourceId + Directory.Read, ResourceID + Directory.Write}
183+
var scopes = new [] { ResourceId + "Directory.Read", ResourceID + "Directory.Write"}
184184
```
185185

186186
#### Warning: Should you have one or two slashes in the scope corresponding to a v1.0 Web API

articles/active-directory/develop/scenario-daemon-app-configuration.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,7 @@ config = json.load(open(sys.argv[1]))
301301
app = msal.ConfidentialClientApplication(
302302
config["client_id"], authority=config["authority"],
303303
client_credential={"thumbprint": config["thumbprint"], "private_key": open(config['private_key_file']).read()},
304-
client_claims = {client_ip”: “x.x.x.x}
304+
client_claims = {"client_ip": "x.x.x.x"}
305305
# token_cache=... # Default cache is in memory only.
306306
# You can learn how to use SerializableTokenCache from
307307
# https://msal-python.rtfd.io/en/latest/#msal.SerializableTokenCache

articles/active-directory/identity-protection/howto-identity-protection-graph-api.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ If successful, this returns an authentication token.
147147
To call the API, create a header with the following parameter:
148148

149149
```
150-
`Authorization`=<token_type> <access_token>"
150+
`Authorization`="<token_type> <access_token>"
151151
```
152152

153153
When authenticating, you can find the token type and access token in the returned token.

articles/active-directory/manage-apps/howto-saml-token-encryption.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ This functionality is coming soon.
126126
1. Set the token encryption settings using the **[Set-AzureApplication](https://docs.microsoft.com/powershell/module/azuread/set-azureadapplication?view=azureadps-2.0-preview)** command.
127127
128128
```
129-
Set-AzureADApplication -ObjectId <ApplicationObjectId> -KeyCredentials <KeyCredentialsObject> -TokenEncryptionKeyId <keyID>
129+
Set-AzureADApplication -ObjectId <ApplicationObjectId> -KeyCredentials "<KeyCredentialsObject>" -TokenEncryptionKeyId <keyID>
130130
```
131131
132132
1. Read the token encryption settings using the following commands.

articles/active-directory/users-groups-roles/licensing-ps-examples.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,9 @@ Output:
5757
```
5858
HTTP/1.1 200 OK
5959
{
60-
value: [
60+
"value": [
6161
{
62-
assignedLicenses: [
62+
"assignedLicenses": [
6363
{
6464
"accountId":"f1b45b40-57df-41f7-9596-7f2313883635",
6565
"skuId":"c7df2760-2c81-4ef7-b578-5b5392b571df",
@@ -407,7 +407,7 @@ HTTP/1.1 200 OK
407407
"id": "e61ff361-5baf-41f0-b2fd-380a6a5e406a",
408408
"licenseAssignmentState":[
409409
{
410-
"skuId": "157870f6-e050-4b3c-ad5e-0f0a377c8f4d,
410+
"skuId": "157870f6-e050-4b3c-ad5e-0f0a377c8f4d",
411411
"disabledPlans":[],
412412
"assignedByGroup": null, # assigned directly.
413413
"state": "Active",
@@ -416,7 +416,7 @@ HTTP/1.1 200 OK
416416
{
417417
"skuId": "1f3174e2-ee9d-49e9-b917-e8d84650f895",
418418
"disabledPlans":[],
419-
"assignedByGroup": e61ff361-5baf-41f0-b2fd-380a6a5e406a, # assigned by this group.
419+
"assignedByGroup": "e61ff361-5baf-41f0-b2fd-380a6a5e406a", # assigned by this group.
420420
"state": "Active",
421421
"error": "None"
422422
},

0 commit comments

Comments
 (0)