Skip to content

Commit 6dab614

Browse files
authored
Updated LiChess to use required PKCE authentication (#619)
* Updated LiChess to use required pkce authentication * Removed ExchangeCodeAsync
1 parent ae843c6 commit 6dab614

File tree

3 files changed

+11
-4
lines changed

3 files changed

+11
-4
lines changed

src/AspNet.Security.OAuth.Lichess/LichessAuthenticationDefaults.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ public static class LichessAuthenticationDefaults
4242
/// <summary>
4343
/// Default value for <see cref="OAuthOptions.TokenEndpoint"/>.
4444
/// </summary>
45-
public const string TokenEndpoint = "https://oauth.lichess.org/oauth";
45+
public const string TokenEndpoint = "https://lichess.org/api/token";
4646

4747
/// <summary>
4848
/// Default value for <see cref="OAuthOptions.UserInformationEndpoint"/>.

src/AspNet.Security.OAuth.Lichess/LichessAuthenticationOptions.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@ public class LichessAuthenticationOptions : OAuthOptions
1717
{
1818
public LichessAuthenticationOptions()
1919
{
20+
// Pkce is now mandatory for LiChess
21+
UsePkce = true;
22+
2023
ClaimsIssuer = LichessAuthenticationDefaults.Issuer;
2124
CallbackPath = LichessAuthenticationDefaults.CallbackPath;
2225

test/AspNet.Security.OAuth.Providers.Tests/Lichess/bundle.json

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,17 @@
44
{
55
"comment": "https://lichess.org/api#section/Authentication",
66
"uri": "https://oauth.lichess.org/oauth",
7+
"method": "GET"
8+
},
9+
{
10+
"comment": "https://lichess.org/api#tag/OAuth",
11+
"uri": "https://lichess.org/api/token",
712
"method": "POST",
813
"contentFormat": "json",
914
"contentJson": {
15+
"token_type": "Bearer",
1016
"access_token": "secret-access-token",
11-
"token_type": "bearer",
12-
"refresh_token": "secret-refresh-token",
13-
"expires_in": "600"
17+
"expires_in": 31536000
1418
}
1519
},
1620
{

0 commit comments

Comments
 (0)