Skip to content

Commit d493ac7

Browse files
authored
Rename GetAccessTokenOrdersFeedClaim to GetClientIdFromAccessToken (#161)
1 parent d792ba5 commit d493ac7

2 files changed

Lines changed: 3 additions & 4 deletions

File tree

Examples/BookingSystem.AspNetCore/Controllers/OpenBookingController.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ public async Task<IActionResult> GetOrdersFeed([FromServices] IBookingEngine boo
202202
// Note only a subset of these parameters will be supplied when this endpoints is called
203203
// They are all provided here for the bookingEngine to choose the correct endpoint
204204
// The auth token must also be provided from the associated authentication method
205-
string clientId = User.GetAccessTokenOrdersFeedClaim();
205+
string clientId = User.GetClientIdFromAccessToken();
206206
return (await bookingEngine.GetOrdersRPDEPageForFeed(clientId, afterTimestamp, afterId, afterChangeNumber)).GetContentResult();
207207
}
208208
catch (OpenBookingException obe)
@@ -221,7 +221,7 @@ public async Task<IActionResult> GetOrderProposalsFeed([FromServices] IBookingEn
221221
// Note only a subset of these parameters will be supplied when this endpoints is called
222222
// They are all provided here for the bookingEngine to choose the correct endpoint
223223
// The auth token must also be provided from the associated authentication method
224-
string clientId = User.GetAccessTokenOrdersFeedClaim();
224+
string clientId = User.GetClientIdFromAccessToken();
225225
return (await bookingEngine.GetOrderProposalsRPDEPageForFeed(clientId, afterTimestamp, afterId, afterChangeNumber)).GetContentResult();
226226
}
227227
catch (OpenBookingException obe)

OpenActive.Server.NET/OpenBookingHelper/Authentication/AuthenticationExtensions.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ public static (string clientId, Uri sellerId) GetAccessTokenOpenBookingClaims(th
6363
/// </summary>
6464
/// <param name="principal"></param>
6565
/// <returns></returns>
66-
public static string GetAccessTokenOrdersFeedClaim(this ClaimsPrincipal principal)
66+
public static string GetClientIdFromAccessToken(this ClaimsPrincipal principal)
6767
{
6868
var clientId = principal.GetClientId();
6969
if (clientId != null)
@@ -75,6 +75,5 @@ public static string GetAccessTokenOrdersFeedClaim(this ClaimsPrincipal principa
7575
throw new OpenBookingException(new InvalidAPITokenError());
7676
}
7777
}
78-
7978
}
8079
}

0 commit comments

Comments
 (0)