Git Product home page Git Product logo

vscode-extension's Introduction

Azure AD B2C extension

The Azure AD B2C extension for VS Code lets you quickly navigate through Azure AD B2C custom policies. Create elements like technical profiles and claim definitions. For more information, see Get started with custom policies.

Get started

To start working with your custom policy, open Visual Studio Code, and then open the folder that contains your custom policy XML files. Or, open the policy XML files directly from any folder.

Custom policy navigator

Azure AD B2C custom policy features

Policy upload

You can now upload your policy directly from VS Code.

Autocomplete

Note

Starting August 2021, if the XML, or the XML Tools XML extensions are installed and activated, the XML extension handles the XML completion. For more information, see Troubleshoot policy validity.

With the autocomplete feature, you can save time when customizing a B2C policy. The B2C extension provides you with a list of the policy settings, claims, technical profiles, and claims transformations aggregated from your policy files. Select one of the following attributes and press Ctrl+Space (Cmd+Space), or start typing:

Autocomplete

Custom policy explorer

From the Custom policy explorer, click the XML element type and select the element you want to open. The Custom policy explorer shows elements from the selected file only.

Custom policy navigator

Go to definition and find all references

To go to any XML element definition. Ctrl+click, press F12, or right-click and select Go to Definition or Peek Definition. Go to definition navigates you to the source element in the selected file only.

To search for references in the opened folder XML files or any XML file you open with VS Code, select Find All References, or press Shift+F12.

Go to definition and find all references

Adding XML elements

You can add following elements to your policy. Make sure your cursor is located in the correct location.

  • B2C Add Identity provider technical profile (Shift+Ctrl+1)
  • B2C Add REST API technical profile (Shift+Ctrl+2)
  • B2C Add Claim Type (Shift+Ctrl+3)
  • B2C Add Application Insights (debug mode) (Shift+Ctrl+4)

Adding XML elements

Orchestration steps renumbering

The B2C Renumber policy (Shift+Ctrl+r) command renumbers all of the user journeys and sub journeys orchestration steps.

Orchestration steps renumbering

Smart Copy & Paste

When you customize an XML element in the extension policy, Smart Copy allows you to copy the entire element with its parent's elements from the base policy. For example, when you copy the AAD-UserWriteUsingAlternativeSecurityId technical profile, Smart Copy generates an XML snippet containing the following elements so you don't need to search for the parent's element, such as the claim provider.

<ClaimsProviders>
  <ClaimsProvider>
    <DisplayName>Azure Active Directory</DisplayName>
    <TechnicalProfiles>
      <TechnicalProfile Id="AAD-UserWriteUsingAlternativeSecurityId">
        ...
      </TechnicalProfile>
    </TechnicalProfiles>
  </ClaimsProvider>
<ClaimsProviders>

By contrast, the Smart Paste feature pastes from the clipboard only the necessary elements. Given the above XML and assuming your extension policy already has a claims provider named Azure Active Directory, Smart Paste will paste only the technical profile without the claims provider. However, if there is no such claims provider, Smart Paste will paste the entire XML (including the claims provider and the technical profile).

Smart copy and paste

Note: In this version, Smart Copy and Paste is limited to a single XML node.

Help and more information

After you run the commands, the B2C extension shows you an informational message with a link to relevant article.

InformationMessage

XML Schema quick help

Hover your mouse cursor over any XML tag name to see its description.

XML Schema quick help

Application Insights

Collect logs from Azure AD B2C and diagnose problems with the Azure AD B2C VS Code extension. Read more here. The logs are organized by the policy name, correlation Id (the application insights presents the first digit of the correlation Id), and the log timestamp. This allows you to find the relevant log based on the local timestamp and see the user journey as executed by Azure AD B2C.

Application Insights

Policy settings

Allows you to manage the values of your Azure AD B2C environments. When you execute the B2C Policy build command, the VS Code extension finds and replaces the values of your settings with the ones configured in the policy file, and creates a directory that contains all of your policy files (after the replacement). In the following example, the extension replaces the keys with the values configured in the appsettings.json file:

  • {Settings:Tenant}
  • {Settings:IdentityExperienceFramework}
  • {Settings:ProxyIdentityExperienceFrameworkAppId}
  • {Settings:FacebookAppId}

App Settings

The configuration appsettings.json file contains the keys with their values for each environment.

  • Name contains the environment name that VS Code extension uses to create the environment folder (under the environments parent folder). Use your operating system's legal characters only.
  • Tenant specifies the tenant name, such as contoso.onmicrosoft.com. In the policy file, use the format of Settings:Tenant, for example {Settings:Tenant}.
  • Production (boolean) is preserved for future use, indicating whether the environment is a production one.
  • PolicySettings contains a collection of key-value pairs with your settings. In the policy file, use the format of Settings: and the key name, for example {Settings:FacebookAppId}.

To build your policy, type Ctrl+Shift+P, which brings up the Command Palette. From here, type B2C and select B2C Policy Build. You have access to all of the B2C functionality of VS Code, including keyboard shortcuts like Ctrl+Shift+5.

policy build

In your policy, you can use one of the following settings:

Key Description
{Settings:Tenant} The tenant name
{Settings:Filename} The policy file name, without the file extension.
{Settings:PolicyFilename} The policy name, without the file extension. Also truncates the B2C_1A_ prefix if included.
{Settings:Environment} The name of the environment.
{Settings:<Name>} A custom setting name, such as {Settings:FacebookAppId}.

The first time you run the B2C Policy build command, the VS code extension lets you create the appsettings.json file with a default set of environments, keys, and values:

{
  "Environments": [
  {
    "Name": "Development",
    "Production": false,
    "Tenant": "your-tenant.onmicrosoft.com",
    "PolicySettings" : {
      "IdentityExperienceFrameworkAppId": "Your dev environment AD app Id",
      "ProxyIdentityExperienceFrameworkAppId": "Your AD dev environment Proxy app Id",
      "FacebookAppId": "0"
    }
  },
  {
    "Name": "Test",
    "Production": false,
    "Tenant": "your-tenant.onmicrosoft.com",
    "PolicySettings" : {
      "IdentityExperienceFrameworkAppId": "Your test environment AD app Id",
      "ProxyIdentityExperienceFrameworkAppId": "Your test environment AD Proxy app Id",
      "FacebookAppId": "0"
    }
  },
  {
    "Name": "Production",
    "Production": true,
    "Tenant": "your-tenant.onmicrosoft.com",
    "PolicySettings" : {
      "IdentityExperienceFrameworkAppId": "Your production environment AD app Id",
      "ProxyIdentityExperienceFrameworkAppId": "Your production environment AD Proxy app Id",
      "FacebookAppId": "0"
    }
  }]
}

You can add or remove environments, keys, and values to accommodate your needs. For example, you can add new settings like the URL of a REST API endpoint, Google+ app Id, or URL of content definitions. You can also add a new environment, such as pre-prod. Make sure you provide the same set of keys (with the relevant values) for each environment. In the following example, we add the Pre-Production environment and new set of key-values.

{
  "Environments": [
  {
    "Name": "Development",
    ...
  },
  {
    "Name": "Test",
    ...
  },
  {
    "Name": "QA",
    ...
  },
  {
    "Name": "Pre-Production",
  },
  {
    "Name": "Production",
    "Production": true,
    "Tenant": "your-tenant.onmicrosoft.com",
    "PolicySettings" : {
      "IdentityExperienceFrameworkAppId": "Your AD app Id",
      "ProxyIdentityExperienceFrameworkAppId": "Your AD Proxy app Id",
      "FacebookAppId": "0",
      "MicrosoftAppId": "0",
      "GoogleAppId": "0",
      "RESTApiServer": "The location of your REST API",
      "HTMLPagesServer": "The location of your HTML page layout files"
    }
  }]
}

Get B2C application IDs

This command retrieves application ids of applications used in IEF policies and stores them in the appSettings.json file. It retrives application ids for the IEF client and resource apps (used in the login-NonInteractive Technical Profile) and application id and object id of the B2C Extensions app (used in the AAD-Common Technical Profile if needed to to store custom claims as extension attributes in B2C). The command retrieves the values for each B2C tenant identified in the appSettings.json, as per the following example. You can then reference these values using Policy Settings build command described earlier.

To execute the command press Shift+Ctrl+P and select the 'B2C appSettings: get app ids' option.

Your B2C VSCode Extensions app needs to given Directory.ReadAll delegated permission and consented to in each B2C tenant by its administrator.

{
    "Environments": [
        {
            "Name": "Development",
            "Production": false,
            "Tenant": "devtenant.onmicrosoft.com",
            "PolicySettings": {
                "ProxyIdentityExperienceFrameworkAppId": "c805c589-d4e2-43bd-bd75-e1e88df44d2c",
                "FacebookAppId": "0",
                "AADExtensionsAppId": "0428f335-4957-491e-96bb-7ce51b81d46a",
                "AADExtensionsObjectId": "20d75341-a1e5-4ea8-a88f-7e7dfe90b9d8",
                "IdentityExperienceFrameworkAppId": "221dfbdb-064b-4747-a7db-a2b7e9d8865a"
            }
        },
        {
            "Name": "Production",
            "Production": true,
            "Tenant": "prodtenant.onmicrosoft.com",
            "PolicySettings": {
                "ProxyIdentityExperienceFrameworkAppId": "ee90b278-ba82-4dd2-a1b7-ed12aa6f11bf",
                "FacebookAppId": "0",
                "IdentityExperienceFrameworkAppId": "081becc7-eab8-4af1-89c4-eeb8892671a3",
                "AADExtensionsAppId": "bd365420-5f77-4cb6-a224-ef794c2d05e1",
                "AADExtensionsObjectId": "4728bfb6-ff0b-4d84-8402-dc38f2c85da9"
            }
        }
    ]
}

After the command is completed, you will find the exported policies under the Environment folder. Important: Before you upload the policy to your Azure AD B2C tenant, check the values of the exported policy files.

Disclaimer

This extension is developed and managed by the open-source community on GitHub. The extension is not part of Azure AD B2C product and is not supported under any Microsoft standard support program or service. The extension is provided AS IS without warranty of any kind. For any issues, visit the GitHub repository.

vscode-extension's People

Contributors

dependabot[bot] avatar despian avatar felickz avatar fume avatar jassuri avatar karrocon avatar locktar avatar mmacy avatar mrochon avatar nevseev avatar norrch2 avatar rbinrais avatar trittimo avatar viper61x23 avatar whippsp avatar yoelhor avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

vscode-extension's Issues

Build All Policies fails

I can use build all policies just fine, but when I try to Upload All Policies the command fails with No B2C policies found in <no value here>. I can upload individual policies as well.

My template policy documents exist within a policy_documents folder within my repo, and this structure is duplicated within the Environments directory. Placing my templates in to the repo root and re-building changes the Environment directory structure, and the error message becomes settings:tenant is neither a valid DNS name, nor a valid external domain. The tenant setting is indeed set correctly, so I'm not sure why this doesn't work correctly.

For now I can just upload individual policies for testing.

Wrong folders used during PolicyBuild

There are a couple issues lurking behind the scenes in this part of the code when you change the defaults in the appsettings.json file and expect the Policies to be built from "PoliciesFolder" into the "EnvironmentsFolder"

image

I believe the provided PoliciesFolder setting should be used to scan for policies. If it's null scan from the root only instead.

Later when creating the environmentsRootPath variable you join with the hardcoded value "Environments" instead of using the provided EnvironmentsFolder setting.

Cannot Login

I've followed the instructions here, however, when I attempt to sign in to azure, I get the following error:

AADSTS500113: No reply address is registered for the application.

To be clear, I am doing the following after I have registered the graph API permitted application on Azure:

  1. Run the vscode command palette with "B2C Upload Policy"
  2. I get prompted to login, click login.
  3. Enter code
  4. Login with my credentials
  5. See the error screen

Do I need setup a redirect link or something in the application auth settings:
image

Thanks

How to escape double quotes in appsettings?

Hey team, my team is building some custom AD B2C policies and I'm looking to embed some XML metadata in my custom policy files. Production metadata is different than dev, so I'd like to be able to specify the metadata in the appsettings.json policy. However, adding the XML metadata in appsettings causes errors that leave the policy unable to be built. I've tried escaping double quotes in the metadata with single, double, and triple backslashes and removing line breaks, but none of this will resolve the errors. Any suggestions or assistance with how to accomplish this?

{
    "Environments": [
    {
      "Name": "Production",
      "Production": true,
      "Tenant": "my-tenant.onmicrosoft.com",
      "PolicySettings" : {
        "TenantId": "my-tenant GUID",
        "RelyingPartyPolicyName": "policyName",
        "AppInsightsKey": "myAppInsightsKey",
        "CertName": "myCertName",
        "DevPrefix": "",
        "RelyingPartyMetadata": "<md:EntityDescriptor xmlns:md="urn:oasis:names:tc:SAML:2.0:metadata" ID="myId" cacheDuration="PT1440M" entityID="myEntityId">
   <md:SPSSODescriptor protocolSupportEnumeration="urn:oasis:names:tc:SAML:2.0:protocol">
      <md:AssertionConsumerService index="0" Location="https://google.com" Binding="urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST" isDefault="true" />
      <md:AttributeConsumingService index="0">
         <md:ServiceName xml:lang="en">AttributeContract</md:ServiceName>
         <md:RequestedAttribute Name="EmployeeID" />
         <md:RequestedAttribute Name="displayName" />
      </md:AttributeConsumingService>
   </md:SPSSODescriptor>
   <md:ContactPerson contactType="administrative" />
</md:EntityDescriptor>"
      }
    ]
  }

Renaming xml files on build

I see that there are new Filename and PolicyFileName parameters, but there is very little explanation on how to use them. I looked at the source and I was wondering if this could be used to rename xml files on build For exemple, I would like to have some "versioned" files with a suffix in the name to be able to deploy them in my dev tenant without impacting other developpers and testers. I added a custom settings "VersionNumber": "1234" in my appsettings file and used it in my policies like :

<TrustFrameworkPolicy xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
  xmlns="http://schemas.microsoft.com/online/cpim/schemas/2013/06" PolicySchemaVersion="0.3.0.0" 
  TenantId="{Settings:Tenant}" 
  PolicyId="B2C_1A_TrustFrameworkBase{Settings:VersionNumber}" 
  PublicPolicyUri="http://{Settings:Tenant}/B2C_1A_TrustFrameworkBase{Settings:VersionNumber}" 
  TenantObjectId="{Settings:TenantObjectId}">

This produces the files with correct values, but with the same B2C_1A_xxxxx.xml filename in my Environment folder. I'd'like to know if it is possible to rename all the xml files generated in this environment? Like maybe use the PolicyId when generating the name? For exemple, since I modified it in my policy, the xml file should be B2C_1A_TrustFrameworkBase1234.xml

Hardcoded folder name 'Environment' breaks "upload all policies" command

Hi,

I've configured in appsettings.json folderpath to be "EnvironmentsFolder": "release"

configured extension workspace settings with respective env name.

Execute the upload all policy and extension cannot locate the folder :-(

Looked up in code and looks to me hard-coded value and it expects the Environment folder name to be 'Environment'

I reverted my config to match the name and tried it worked.

policiesPath += `/Environments/${targetEnvironment}`;

Policy Build throws error due to missing 'journeys' element

Extension version: 1.3.2
I have a series of policy files, each of which contains either BuildingBlocks, ClaimsProviders, UserJourneys, or RelyingParty elements. When I use the extensions "Policy Build" command (Ctrl + Shift + 5 shortcut), the policies are not built and I see the following stack trace in the Dev Tools:

  ERR Cannot read property 'journeys' of undefined: TypeError: Cannot read property 'journeys' of undefined
    at Policy.hasPolicyId (c:\Users\<name>\.vscode\extensions\azureadb2ctools.aadb2c-1.3.2\out\OrchestrationStepsRenumber.js:114:29)
    at Policy.process (c:\Users\<name>\.vscode\extensions\azureadb2ctools.aadb2c-1.3.2\out\OrchestrationStepsRenumber.js:146:40)
    at Policy.process (c:\Users\<name>\.vscode\extensions\azureadb2ctools.aadb2c-1.3.2\out\OrchestrationStepsRenumber.js:135:23)
    at Function.RenumberPolicies (c:\Users\<name>\.vscode\extensions\azureadb2ctools.aadb2c-1.3.2\out\OrchestrationStepsRenumber.js:52:20)
    at c:\Users\<name>\.vscode\extensions\azureadb2ctools.aadb2c-1.3.2\out\PolicyBuild.js:61:62
    at processTicksAndRejections (internal/process/task_queues.js:93:5)

It looks like a recent PR ( #69 ) references this.journeys.has(...) in hasPolicyId which is causing this issue.

Should this read this.base.journeys.has(...) instead?

Rolling back to 1.3.1 allows me to build policies again.

Ability to include/exclude certain files from different environments

Would it be possible to add the feature that allows a single VSCode folder to contain several policy files that only get uploaded to certain environments?

Example:
One source control folder with all policy files open in VSCode. Three environments. en-a, en-b, en-c
Some common policy files would be uploaded to all environments. But certain policy files would only be uploaded to en-a, or en-b, or en-c

Default environment name in the extension's settings for Upload all policies

I could successfully upload just one policy with this new method described here.

However at the end of this doc it's mentioned that it's possible to upload all policies at once. For this to happen we need to set the default environment name:

The default environment name in the extension's settings needs to be configured before using 'Upload all policies' command.

I'm using the extension v. 1.2.74 right now... I couldn't find the place to set the default environment name.

Can you explain where it is or the extension in Visual Studio code still needs to be updated?

2019-08-02_12-10-47 Github

Thanks.

Application Insights produced empty results

I'm not getting any Trace info in VSCode - get error "Application Insights produced empty results"

I can see the Trace information is being logged in App Insights ... it just not getting to the VSCode panel

Build-all-fail

Failing on build-all task, however build current file works.

Screen Shot 2022-02-20 at 17 58 16

Find all references not working

I installed this extension on my new machine and started to use modify my policies however Find all reference feature is not working. I am not sure if i am missing something or this is some type of bug.
Is there any open issue related to this?

Extension issue

  • Issue Type: Bug
  • Extension Name: aadb2c
  • Extension Version: 1.3.0
  • OS Version: Windows_NT x64 10.0.19043
  • VS Code version: 1.55.2

⚠️ We have written the needed data into your clipboard. Please paste! ⚠️

It suddenly stopped working

I used to be able to open a policy xml file and the outline of the content would be available in "AZURE AD B2C POLICY EXPLORER". Somehow it stopped working suddenly. I tried to disable/enable and uninstall/reinstall it but couldn't get it back. What can I do now?

Policy Build is not working

image
image
image

The policy build shows that the policies have successfully exported. But when looking into the policy root folder, no environments are created.

VS Code Version: 1.47.2
azureadb2ctools.aadb2c Version: v1.2.92

From the Extension log file:

[2020-07-23 17:09:15.203] [exthost] [error] [AzureADB2CTools.aadb2c] provider FAILED
[2020-07-23 17:09:15.203] [exthost] [error] Error: Illegal argument, contents must be defined
at new B (c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:440:527)
at new B (c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:429:431)
at c:\Users\ansary.rd.vscode\extensions\azureadb2ctools.aadb2c-1.2.92\out\HoverProvider.js:38:28
at processTicksAndRejections (internal/process/task_queues.js:85:5)

[Feature Request] - Building Policies allows for a {Setting:Filename} token that uses the actual (XML) filename

Allow a special {Setting:Filename} token to be used within the B2C Build Policy command that will be replaced with the name of the file on disk.

Notes:

  • Would truncate the file extension (.XML)
  • Would truncate B2C_1[A]_ if a developer included that in the filename
  • Would replace unsupported characters with underscore (_)
  • Would ignore a Filename value in the appsettings.json

Examples:

Filename Value of {Setting:Filename}
TrustFrameworkBase.xml TrustFrameworkBase
TrustFramework.Base.xml TrustFramework_Base
PasswordReset.xml PasswordReset
B2C_PasswordReset.xml PasswordReset
B2C_1A_PasswordReset.xml PasswordReset
B2C_1_PasswordReset.xml PasswordReset
Password.Reset.xml Password_Reset
Password_Reset.xml Password_Reset

Note - I am not 100% sold on the removal of B2C_1[A], because a developer can add or remove that in his/her Policy files where they will use.

Overall Value

In most cases, I am finding that I am creating a file that is the same as the Policy Name/ID. I could simplify my policy header if the {Setting:Filename} token could just match the name of the file in my repository.

Build on auto-save

I created a environment with Azure Pipeline, but I can't automate all steps in deploy (for example, I have two environments HML & PROD, but to deploy I have to build policies and push to master)

Summary:

Implemment Auto build on ctrl-s (save) in VSCode could be a solution

B2C extension notready for tenant.partner.onmschina.cn

We like your B2C extension.
However, we realized it is not compatible with azure AD B2C China: tenant.partner.onmschina.cn

MSGraphTokenHelper.ts

tenantId = tenantId.toLowerCase().replace(Consts.SamplesYourTenant, MSGraphTokenHelper.getMSGraphDefaultTenantID() + ".onmicrosoft.com")

PolicyUpload.ts

docContent = docContent.replace(new RegExp("\yourtenant.onmicrosoft.com", "gi"), MSGraphTokenHelper.getMSGraphDefaultTenantID() + ".onmicrosoft.com");

Policy Build not working

Maybe I am doing something wrong, but when I try the policy build no policies are generated. The only thing that gets generated are the directories, but they are all empty.

Multiple Security Vulnerabilities Found in Repository

Hello Team.

I hope you are doing wel. I am reaching out to inform you of a critical security matter. After cloning the repository, I have identified several vulnerabilities across multiple dependencies. These issues range in severity.

Key Vulnerabilities identified:

  • Improper Input Validation [Critical Severity]
  • Improper Input Validation [Critical Severity]: Introduced by [email protected] > @xmldom/[email protected], can be fixed by upgrade.

Upgrading these dependencies will not only resolve the current vulnerabilities but will also enhance the overall security posture of the project.

App InSight Date Issue

I have enabled the App Insight and getting the logs. I observed that there is difference in DateTime Showing in the B2C Trace and App InSight Explorer. Below are the screenshots.

B2C Trace App Insight

image

App InSight Explorer

image

Is this how the system has been design or there is any issue?

Refactor Build Policy functionality

I'd like the be able to use the build policy functionality as part of a custom Azure Pipelines task that could build the policy during a build.

Would you accept a PR that refactors that module and exports it so it can be imported and used by other NPM libraries?

Build recursively populating Environments folder until crash

Extension version: 1.2.101
Description of bug:
Build is recursively populating the Environments folder until VS Code crashes.
image

It appears that this only happens if you build when there is a pre-existing Environments folder there.

I downgraded to 1.2.93 and things work normally again. Haven't tried all the versions in between.

Reproduction steps:

  1. Create a new folder
  2. Create TrustFrameworkBase.xml. I just copied from one of my projects, I don't believe the content matters (although I haven't experimented here)
  3. Create a new appsettings.json w/ the following content:
{
    "Environments": [
        {
            "Name": "Sandbox",
            "Production": false,
            "Tenant": "yourtenant.onmicrosoft.com",
            "PolicySettings" : {
                "PolicySuffix": ""
            }
        },
        {
            "Name": "Testing",
            "Production": false,
            "Tenant": "yourtenant.onmicrosoft.com",
            "PolicySettings" : {
                "PolicySuffix": ""
            }
        }
    ]
}
  1. Build
  2. Build again
  3. See that you now have a recursive tree

Is it possible to have b2c build replace a value from settings?

I'd like to be able to do this:

<!--Sample action required: replace with your endpoint location -->
<Item Key="METADATA">{Settings:AzureAppServiceUrl}/.well-known/openid-configuration</Item>

When I run b2c build, {Settings:AzureAppServiceUrl} value is not replaced.

Where:

"AzureAppServiceUrl": "https://myapp.azurewebsites.net"

From the readme this should work out of the box but somehow it doesn't.

If I do:

<Item Key="METADATA">{Settings:Tenant}/.well-known/openid-configuration</Item>

it works... but if I do:

<Item Key="METADATA">{Settings:AzureAppServiceUrl}/.well-known/openid-configuration</Item>

it doesn't replace with the value I set and keeps this as a result in the transformed file:

<Item Key="METADATA">{Settings:AzureAppServiceUrl}/.well-known/openid-configuration</Item>

VS Code Extension not working on Mac

Attempting to use the VSCode Extension for B2C on a Mac does not load the B2C tools. Even-though the custom policy xml file is open.

Screen Shot 2020-09-22 at 10 58 31 AM
Screen Shot 2020-09-22 at 11 01 25 AM

Azure AD B2C

v1.2.93

VsCode Version

Version: 1.49.1
Commit: 58bb7b2331731bf72587010e943852e13e6fd3cf
Date: 2020-09-16T23:21:17.533Z (5 days ago)
Electron: 9.2.1
Chrome: 83.0.4103.122
Node.js: 12.14.1
V8: 8.3.110.13-electron.0
OS: Darwin x64 19.6.0

Mac Version

macOSCatalina - 10.15.6

APP INSIGHTS - Cannot parse the json data

Regularly getting a json parse error - Seems to be intermittent when it triggers but once it does it won't work on those particular logs.

Unexpected token c in JSON at position 114393 (number varies)

Shared PolicySettings from appsettings.json

Is is possible to have a set of PolicySettings values that are common across all Environments. If the same setting is declare in a given environment section, it is overridden?

eg:

{
  "Defaults" : [{
       "PolicySettings" : {
           "Setting1" : "Foo",
           "Setting2" : "Bar",
           ... etc
       }
  ]},
  "Environments" : [{
      "Name" : "Test",
      "PolicySettings" : {
            "Setting1" : "Alpha",
            "Setting3" : "Beta",
            .... etc
      }
  }]
}

So "Setting1" and "Setting2" have a default of "Foo" and "Bar" respectively.

For the environment "Test",

  • "Setting1" is "Alpha",
  • "Setting2" is "Bar"
  • "Setting3" is "Beta"

Failed to parse App Insights JSON data: Unexpected token o in JSON at position 0

Application Insights
Policy: B2C_1A_SIGNIN
Correlation Id: 02fcd83d-553a-4743-b8cb-e3c73dc1cb87
App insights Id: dfbef799-bd62-11ed-a10a-002248291c02, dfbef795-bd62-11ed-a10a-002248291c02 (The report shows a combination of two Application Insight entities)
App insights timestamp: 2023-03-07 19:39:02
User journey is completed: Unknown (JSON parse exception)
Orchestration steps: , 3, 2, 2
Internal error
Failed to parse App Insights JSON data: Unexpected token o in JSON at position 0

Support token replacements in html templates for custom content definitions when building policies

Would be useful to support environment substitution in HTML templates for custom content definitions. If, for example, I was to create a sub-folder called templates in the same folder as the policy xml files and run the Policy Build tool for an environment it could apply the environment transformations to those files also to replace things like absolute references to resources in the storage account hosting to the content (e.g. images, styles etc. )

Skip renumbering seems to be inconsistent

I have various custom policies files which override a particular orchestration step of the base user journey. Building multiple times the same files lead to different behaviors:

  • Sometimes the Orchestration Steps are renumbered (which is wrong)
  • Sometimes the Orchestration Steps renumbering is skipped (which is correct)

For example, this is a custom policy (B2C_1A_signin_aad_exlibris_JWT) file which overrides the SendClaims OrchestrationStep n.7
image
Building the policy, the orchestration step is renumbered:
image
Rebuilding the policy (without resetting the Order to 7), the orchestration step renumbering is skipped:
image

This inconsistent behavior may lead to errors while uploading policies, especially if you override the SendClaims OrchestrationSteps, because you'll end up having 2 SendClaims steps which is not allowed. In the worst case, when you're not overriding the SendClaims step, you could upload policies successfully but the logic will be completely broken at runtime.

vscode.window.showInformationMessage(`Skipped renumbering ${this.policyId} because it has a base journey in another file`);

[Feature Request] Support building policies not in root folder

I have some experimental custom policies that I want to manage within the same project but with separate implementations. To enable this, I'd like the extension's "Build policies" task to support folders other than the root folder so that it will work if I have the following file structure:

- Experiment1
  - TrustFrameworkBase.xml
  - TrustFrameworkExtensions.xml
  - appsettings.json
- Experiment2
  - TrustFrameworkBase.xml
  - appsettings.json

This also matches the AD B2C sample implementations repo https://github.com/azure-ad-b2c/samples/tree/master/policies

Upload multiple environments

is it possible to setup multiple environments to be uploaded?

For example I want to upload to Dev Env A and Dev Env B at the same time?

image

Incorrect order for application insights

I have noticed that the later versions > 1.2.106 do not put the logs in the correct order.

I have a custom policy with a SubJourney. With v1.2.106 it looks like this:
image

The SubJourney covers covers the steps 2,3,4 (9:22:08) and 9,10,11 (9:22:48) - As you can see step 9 is not in the right order but it is on it own entry so that is generally fine.

When I update to anything > 1.2.106 the order is a mess, here is the order for the same transaction on 1.3.
image

When the order is messed up it is impossible to trace though as the logs do not seem to contain all the data for each step.

Is this caused by having SubJourneys?

Duplicate display of policy in App Insights View

We have been using the App Insights integration to monitor user activity over B2C tenant, and we noticed policies being duplicated in the view, once stated with Capital letters once with lower letters. See attached screenshot. As the name of the policy in the logs is same we were wondering what might be the root cause of this.

image

Error running Build-CustomPolicies.ps1

When running the Build-CustomPolicies.ps1 script on MacOS, the file paths are getting merged incorrectly and I get errors like this:

Could not find a part of the path '/Users/xxxxx/Example/CustomPolicies/Environments/Development/Users/xxxxx/Example/CustomPolicies/TrustFrameworkExtensions.xml'

This might have to do with differences in how Get-ChildItem works on Windows vs Unix-like systems, but I found adding the flag to return only filenames fixes the issue:

$XmlPolicyFiles = Get-ChildItem -Path $FilePath -Filter *.xml

turns into

$XmlPolicyFiles = Get-ChildItem -Path $FilePath -Filter *.xml -Name

I can make a PR if that's helpful.

Policy upload always asks to login and does not upload policy

I've followed the steps in your article that linked to the instructions in configuring the VSCode to upload a custom policy doc, by configuring Graph API with B2C (https://github.com/azure-ad-b2c/vscode-extension/blob/master/src/help/policy-upload.md)

When i do a SHIFT + CTRL + U in VS code I get a login prompt, I copy the code into the web page, login and get the message "You have signed in to the Graph API application on your device. You may now close this window."

When do SHIFT + CTRL + U again I get the same login prompt in VS Code!?

When setting the Reply URL for the Graph Api in B2C I set it to https://[MyB2CTenant].b2clogin.com/oauth2/nativeclient

Is this a bug, what should happen from VSCode once I have logged in?

Using VSCode 1.45.1 on WIndows 10

Maximum call stack size exceeded

The Runtime Status on the extension has two entries for this error. I'm not sure how to provide additional info as of right now so let me know if there's something I need to do on my end to help you resolve this. Thx

image

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.