Skip to content

Conversation

Copilot
Copy link
Contributor

@Copilot Copilot AI commented Aug 26, 2025

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:

  • Where this admin key comes from
  • How to generate or obtain it for different scenarios
  • How to store and retrieve it for authentication operations

Solution:
Added comprehensive guidance on admin key management:

  1. New "Obtaining the admin key" section explaining different scenarios:

    • Virtual smart cards you created (use the same key from creation)
    • Existing physical/virtual cards (provided by IT/card management system)
    • Development/testing (generate with CryptographicBuffer.GenerateRandom(24))
  2. Example admin key management methods showing practical implementations:

    • SaveAdminKeySecurely() - stores admin key in app settings with Base64 encoding
    • GetStoredAdminKey() - retrieves stored admin key with proper error handling
  3. Updated code examples to use the new management methods:

    • Authentication example now calls GetStoredAdminKey() instead of undefined rootPage.AdminKey
    • PIN reset example includes clear comments about admin key source
    • Connected virtual card creation workflow with subsequent authentication operations

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.

Copy link
Contributor Author

Copilot AI commented Aug 26, 2025

@alvinashcraft 👋 This repository doesn't have Copilot instructions. With Copilot instructions, I can understand the repository better, work faster and produce higher quality PRs.

I can generate a .github/copilot-instructions.md file for you automatically. Click here to open a pre-filled issue and assign it to me. I'll write the instructions, and then tag you for review.

Copy link
Contributor

Learn Build status updates of commit 27bd33e:

⚠️ Validation status: warnings

For more details, please refer to the build report.

Note: Your PR may contain errors or warnings or suggestions unrelated to the files you changed. This happens when external dependencies like GitHub alias, Microsoft alias, cross repo links are updated. Please use these instructions to resolve them.

Co-authored-by: alvinashcraft <73072+alvinashcraft@users.noreply.github.com>
@Copilot Copilot AI changed the title [WIP] Authentication example is useless Fix smart cards authentication example - show how to obtain adminKey Aug 26, 2025
Copilot finished work on behalf of alvinashcraft August 26, 2025 13:58
Copy link
Contributor

Learn Build status updates of commit 9336ab7:

✅ Validation status: passed

File Status Preview URL Details
hub/apps/develop/security/smart-cards.md ✅Succeeded

For more details, please refer to the build report.

Copy link
Contributor

Learn Build status updates of commit f1dc3f6:

✅ Validation status: passed

File Status Preview URL Details
hub/apps/develop/security/smart-cards.md ✅Succeeded

For more details, please refer to the build report.

@alvinashcraft alvinashcraft marked this pull request as ready for review August 26, 2025 14:09
@alvinashcraft alvinashcraft merged commit 691d5d4 into docs Aug 26, 2025
2 checks passed
@alvinashcraft alvinashcraft deleted the copilot/fix-2253 branch August 26, 2025 14:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Authentication example is useless

2 participants