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