-
Notifications
You must be signed in to change notification settings - Fork 218
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added an integration test validating the certificate rotation (including app registration of short time self-assigned certificates) Added a way for the apps to observe that the certs are selected or unselected (#2498). This is currently an experimental feature (to get feedback) Improved the cert rotation and fixed an issue in the rotation of client certificates. - Adding a ResetCertificates with an override for an enumeration of CredentialDescription - (unrelated) fixing mappings in OWIN devapps
- Loading branch information
Showing
10 changed files
with
486 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
62 changes: 62 additions & 0 deletions
62
src/Microsoft.Identity.Web.TokenAcquisition/ICertificatesObserver.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
// Copyright (c) Microsoft Corporation. All rights reserved. | ||
// Licensed under the MIT License. | ||
|
||
using System.Security.Cryptography.X509Certificates; | ||
using Microsoft.Identity.Abstractions; | ||
|
||
// Types in the Microsoft.Identity.Web.Experimental namespace | ||
// are meant to get feedback from the community on proposed features, and | ||
// may be modified or removed in future releases without obeying to the | ||
// semantic versionning. | ||
namespace Microsoft.Identity.Web.Experimental | ||
{ | ||
/// <summary> | ||
/// Action of the token acquirer on the certificate. | ||
/// </summary> | ||
public enum CerticateObserverAction | ||
{ | ||
/// <summary> | ||
/// The certificate was selected as a client certificate. | ||
/// </summary> | ||
Selected, | ||
|
||
/// <summary> | ||
/// The certificate was deselected as a client certificate. This | ||
/// happens when the STS does not accept the certificate any longer. | ||
/// </summary> | ||
Deselected, | ||
} | ||
|
||
/// <summary> | ||
/// Event argument about the certificate consumption by the app | ||
/// </summary> | ||
public class CertificateChangeEventArg | ||
{ | ||
/// <summary> | ||
/// Action on the certificate | ||
/// </summary> | ||
public CerticateObserverAction Action { get; set; } | ||
|
||
/// <summary> | ||
/// Certificate | ||
/// </summary> | ||
public X509Certificate2? Certificate { get; set; } | ||
|
||
/// <summary> | ||
/// Credential description | ||
/// </summary> | ||
public CredentialDescription? CredentialDescription { get; set; } | ||
} | ||
|
||
/// <summary> | ||
/// Interface that apps can implement to be notified when a certificate is selected or removed. | ||
/// </summary> | ||
public interface ICertificatesObserver | ||
{ | ||
/// <summary> | ||
/// Called when a certificate is selected or removed. | ||
/// </summary> | ||
/// <param name="e"></param> | ||
public void OnClientCertificateChanged(CertificateChangeEventArg e); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.