-
Notifications
You must be signed in to change notification settings - Fork 69
Multiple Issues found in this sample #11
Description
There are some bugs in this sample
1.GitHub readme file mentioned to change client id, Client secret, and tenantid but didn’t mentioned about the changes needs to be done at B2cExtensionAppClientId in ./src/appsettings.json
2. Regarding the custom attribute, it was mentioned that Add 2 custom attributes to your B2C instance in order to run all the sample operations with custom attributes involved. After adding the 2 custom attributes I am getting the error.
So I created an extension property for the B2c extension app, Using Powershell:
New-AzureADApplicationExtensionProperty -ObjectId <> -Name "FavouriteSeason" -DataType "String" -TargetObjects "User"
once the extension properties are created, I again ran the sample and execute the command "7" it Gave me this :
Enter command, then press ENTER: 7
Create a user with the custom attributes 'FavouriteSeason' (string) and 'LovesPets' (boolean)
Created the new user. Now get the created user with object ID 'f45e7487-2459-4aba-a227-d7de5d932f63'...
DisplayName: Casey Jensen
FavouriteSeason: summer
LovesPets: True
{
"displayName": "Casey Jensen",
"givenName": "Casey",
"identities": [
{
"signInType": "emailAddress",
"issuer": "AADCxPb2c.onmicrosoft.com",
"issuerAssignedId": "casey.jensen@example.com",
"@odata.type": "microsoft.graph.objectIdentity"
},
{
"signInType": "userPrincipalName",
"issuer": "AADCxPb2c.onmicrosoft.com",
"issuerAssignedId": "f45e7487-2459-4aba-a227-d7de5d932f63@AADCxPb2c.onmicrosoft.com",
"@odata.type": "microsoft.graph.objectIdentity"
}
],
"surname": "Jensen",
"id": "f45e7487-2459-4aba-a227-d7de5d932f63",
"@odata.type": "microsoft.graph.user",
"@odata.context": "https://graph.microsoft.com/beta/$metadata#users(id,givenName,surname,displayName,identities,extension_f5bfc20b6a7248b7a3b7745f6afe97a5_FavouriteSeason,extension_f5bfc20b6a7248b7a3b7745f6afe97a5_LovesPets)/$entity",
"extension_f5bfc20b6a7248b7a3b7745f6afe97a5_FavouriteSeason": "summer",
"extension_f5bfc20b6a7248b7a3b7745f6afe97a5_LovesPets": true,
"responseHeaders": {
"Cache-Control": [
"private"
],
"Vary": [
"Accept-Encoding"
],
"request-id": [
"879ce98c-bba0-4660-bd0d-0d93a7c04baa"
],
"client-request-id": [
"879ce98c-bba0-4660-bd0d-0d93a7c04baa"
],
"x-ms-ags-diagnostic": [
"{"ServerInfo":{"DataCenter":"West US 2","Slice":"SliceC","Ring":"1","ScaleUnit":"001","RoleInstance":"AGSFE_IN_12"}}"
],
"OData-Version": [
"4.0"
],
"Strict-Transport-Security": [
"max-age=31536000"
],
"Date": [
"Wed, 08 Jul 2020 07:30:05 GMT"
]
},
"statusCode": "OK"
}
then the 8 step also worked for me.
3.GitHub sample didn’t mention about the application extension Property they mention to add a custom attribute for b2c instance.