Skip to content

Add client assertion authentication - #145

Open
Dongle (dongle-the-gadget) wants to merge 1 commit into
microsoft:mainfrom
dongle-the-gadget:client-assertion
Open

Add client assertion authentication#145
Dongle (dongle-the-gadget) wants to merge 1 commit into
microsoft:mainfrom
dongle-the-gadget:client-assertion

Conversation

@dongle-the-gadget

Copy link
Copy Markdown

Add support for MSAL Client Assertion authentication. Client Assertion authentication enables users to use GitHub Actions OpenID Connect, which is a more secure way to authenticate to Microsoft services without requiring client secrets.

The Client Assertion mechanism is activated by using the --clientAssertion option in the reconfigure command:

msstore reconfigure --clientId [Client ID] --clientAssertion [OIDC JWT] [other options]

A GitHub workflow that utilizes OpenID Connect might look something like this:

permissions:
  contents: read
  id-token: write

jobs:
  publish:
    runs-on: windows-latest

    steps:
      - name: Login
        run: |
          $oidcToken = ConvertTo-SecureString "$env:ACTIONS_ID_TOKEN_REQUEST_TOKEN" -AsPlainText -Force
          $assertion = Invoke-RestMethod -Uri "$env:ACTIONS_ID_TOKEN_REQUEST_URL&audience=api://AzureADTokenExchange" -Authentication Bearer -Token $oidcToken
          msstore reconfigure --sellerId ${{ secrets.SELLER_ID }} --clientId ${{ secrets.CLIENT_ID }} --clientAssertion $assertion.value --tenantId ${{ secrets.TENANT_ID }}
      - name: Publish
        run: msstore publish example.msix -id <Store App ID>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant