SpotifyProviderOptions class

Configuration for the Spotify OAuth provider.

Callback URL

https://example.com/auth/callback/spotify

Usage

import 'package:server_auth/server_auth.dart';
import 'package:server_auth/server_auth.dart';

final manager = AuthManager(
  AuthOptions(
    store: InMemoryAuthStore(),
    storeMode: AuthStoreMode.ephemeral,
    providers: [
      spotifyProvider(
        SpotifyProviderOptions(
          clientId: env('SPOTIFY_CLIENT_ID'),
          clientSecret: env('SPOTIFY_CLIENT_SECRET'),
          redirectUri: 'https://example.com/auth/callback/spotify',
        ),
      ),
    ],
  ),
);

Constructors

SpotifyProviderOptions({required String clientId, required String clientSecret, required String redirectUri, List<String> scopes = const ['user-read-email']})
Creates a new SpotifyProviderOptions configuration.
const

Properties

clientId → String
OAuth 2.0 client ID from the Spotify Developer Dashboard.
final
clientSecret → String
OAuth 2.0 client secret from the Spotify Developer Dashboard.
final
hashCode → int
The hash code for this object.
no setterinherited
redirectUri → String
The URI to redirect to after authentication.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
scopes → List<String>
OAuth scopes to request. Defaults to ['user-read-email', 'user-read-private'].
final

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited