Skip to content

Commit e35fb02

Browse files
committed
Support OAuth authentication in FileConfiguration
1 parent 0381ea3 commit e35fb02

2 files changed

Lines changed: 5 additions & 2 deletions

File tree

player/src/main/java/xyz/gianlu/librespot/player/FileConfiguration.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -402,6 +402,9 @@ public Session.Builder initSessionBuilder() throws IOException, GeneralSecurityE
402402
case STORED:
403403
builder.stored();
404404
break;
405+
case OAUTH:
406+
builder.oauth();
407+
break;
405408
case ZEROCONF:
406409
default:
407410
throw new IllegalArgumentException(authStrategy().name());
@@ -458,7 +461,7 @@ public PlayerConfiguration toPlayer() {
458461
}
459462

460463
public enum AuthStrategy {
461-
FACEBOOK, BLOB, USER_PASS, ZEROCONF, STORED
464+
FACEBOOK, BLOB, USER_PASS, ZEROCONF, STORED, OAUTH
462465
}
463466

464467
private final static class PropertiesFormat implements ConfigFormat<Config> {

player/src/main/resources/default.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ preferredLocale = "en" ### Preferred locale ###
66
logLevel = "TRACE" ### Log level (OFF, FATAL, ERROR, WARN, INFO, DEBUG, TRACE, ALL) ###
77

88
[auth] ### Authentication ###
9-
strategy = "ZEROCONF" # Strategy (USER_PASS, ZEROCONF, BLOB, FACEBOOK, STORED)
9+
strategy = "ZEROCONF" # Strategy (USER_PASS, ZEROCONF, BLOB, FACEBOOK, STORED, OAUTH)
1010
username = "" # Spotify username (BLOB, USER_PASS only)
1111
password = "" # Spotify password (USER_PASS only)
1212
blob = "" # Spotify authentication blob Base64-encoded (BLOB only)

0 commit comments

Comments
 (0)