@@ -56,8 +56,20 @@ protected override async Task<AuthenticationTicket> CreateTicketAsync(
56
56
return ticket ;
57
57
}
58
58
59
+ // Note: prior to April 2018, the Steam identifier was prefixed with an HTTP base address.
60
+ // Since then, the prefix is now an HTTPS address. The following logic supports both prefixes.
61
+ if ( identifier . StartsWith ( SteamAuthenticationConstants . Namespaces . Identifier , StringComparison . Ordinal ) )
62
+ {
63
+ identifier = identifier . Substring ( SteamAuthenticationConstants . Namespaces . Identifier . Length ) ;
64
+ }
65
+
66
+ else if ( identifier . StartsWith ( SteamAuthenticationConstants . Namespaces . LegacyIdentifier , StringComparison . Ordinal ) )
67
+ {
68
+ identifier = identifier . Substring ( SteamAuthenticationConstants . Namespaces . LegacyIdentifier . Length ) ;
69
+ }
70
+
59
71
// Return the authentication ticket as-is if the claimed identifier is malformed.
60
- if ( ! identifier . StartsWith ( SteamAuthenticationConstants . Namespaces . Identifier , StringComparison . Ordinal ) )
72
+ else
61
73
{
62
74
Logger . LogWarning ( "The userinfo request was skipped because an invalid identifier was received: {Identifier}." , identifier ) ;
63
75
@@ -67,7 +79,7 @@ protected override async Task<AuthenticationTicket> CreateTicketAsync(
67
79
var address = QueryHelpers . AddQueryString ( Options . UserInformationEndpoint , new Dictionary < string , string >
68
80
{
69
81
[ SteamAuthenticationConstants . Parameters . Key ] = Options . ApplicationKey ,
70
- [ SteamAuthenticationConstants . Parameters . SteamId ] = identifier . Substring ( SteamAuthenticationConstants . Namespaces . Identifier . Length )
82
+ [ SteamAuthenticationConstants . Parameters . SteamId ] = identifier
71
83
} ) ;
72
84
73
85
var request = new HttpRequestMessage ( HttpMethod . Get , address ) ;
0 commit comments