Skip to content

Commit e920682

Browse files
Accept api_key query string parameter to support swagger out of the box
1 parent f6a88e0 commit e920682

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/MakingSense.AspNet.Authentication.SimpleToken/SimpleTokenAuthenticationHandler.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ public static string ExtractToken(HttpRequest request)
5353
}
5454

5555
// Search in URI Query Parameter (http://tools.ietf.org/html/rfc6750#section-2.3)
56-
var tokenFromQuery = request.Query["access_token"];
56+
var tokenFromQuery = request.Query["access_token"] ?? request.Query["api_key"];
5757
if (tokenFromQuery != null)
5858
{
5959
return tokenFromQuery.Trim();

0 commit comments

Comments
 (0)