Skip to content

Create session with spotify token failed #753

@cookiedevacc

Description

@cookiedevacc

Describe the bug
I try to create player session using AuthenticationType.AUTHENTICATION_SPOTIFY_TOKEN, but it throw exception
xyz.gianlu.librespot.mercury.MercuryClient$MercuryException: status: 403
When i use username and password for session it works fine.

To Reproduce

Session.Builder sessionBuilder = new Session.Builder(conf);
sessionBuilder
                .credentials(
                        Authentication.LoginCredentials.newBuilder()
                                .setTyp(Authentication.AuthenticationType.AUTHENTICATION_SPOTIFY_TOKEN)
                                .setUsername(profilePrefs.getProfile().getId())
                                .setAuthData(ByteString.copyFrom(tokenPrefs.getToken(), StandardCharsets.UTF_8))
                                .build()
                )
                .setPreferredLocale(Locale.getDefault().getLanguage())
                .setDeviceType(Connect.DeviceType.SMARTPHONE)
                .setDeviceId(deviceId)
                .setDeviceName(deviceName);
playerSession = new WeakReference<>(sessionBuilder.create());

Expected behavior
player session created succesfull

Screenshots/Stracktraces/Logs
Screenshot 2023-10-25 at 17 19 55

Version/Commit
v1.6.3

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions