Skip to content

Commit 75e8166

Browse files
committed
support cname return from enrollment
1 parent 2695756 commit 75e8166

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

cscglobal-caplugin/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
v1.1.0
22
- Support for custom fields in enrollment
3+
- Support for returning CNAME tokens from enrollment call
34

45
v1.0.1
56
- Fixed issue with SANs not being read correctly.

cscglobal-caplugin/RequestManager.cs

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,12 +73,22 @@ public EnrollmentResult
7373
StatusMessage = registrationResponse.RegistrationError.Description
7474
};
7575

76-
return new EnrollmentResult
76+
Dictionary<string, string> cnames = new Dictionary<string, string>();
77+
if (registrationResponse.Result.DcvDetails != null && registrationResponse.Result.DcvDetails.Count > 0)
78+
{
79+
foreach (var dcv in registrationResponse.Result.DcvDetails)
80+
{
81+
cnames.Add(dcv.CName.Name, dcv.CName.Value);
82+
}
83+
}
84+
85+
return new EnrollmentResult
7786
{
7887
Status = (int)EndEntityStatus.EXTERNALVALIDATION, //success
7988
CARequestID = registrationResponse.Result.Status.Uuid,
8089
StatusMessage =
81-
$"Order Successfully Created With Order Number {registrationResponse.Result.CommonName}"
90+
$"Order Successfully Created With Order Number {registrationResponse.Result.CommonName}",
91+
EnrollmentContext = (cnames.Count > 0) ? cnames : null
8292
};
8393
}
8494

0 commit comments

Comments
 (0)