Fix smart cards authentication example - show how to obtain adminKey #5599
+68
−2
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The smart cards authentication documentation was incomplete, showing code examples that used an
adminKey
parameter without explaining how to obtain it. This made the authentication examples essentially unusable for developers.Problem:
The existing code examples assumed developers already had access to
rootPage.AdminKey
without any guidance on:Solution:
Added comprehensive guidance on admin key management:
New "Obtaining the admin key" section explaining different scenarios:
CryptographicBuffer.GenerateRandom(24)
)Example admin key management methods showing practical implementations:
SaveAdminKeySecurely()
- stores admin key in app settings with Base64 encodingGetStoredAdminKey()
- retrieves stored admin key with proper error handlingUpdated code examples to use the new management methods:
GetStoredAdminKey()
instead of undefinedrootPage.AdminKey
The documentation now provides a complete, working example that developers can actually implement.
Fixes #2253.
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.