OauthAuthentication.from constructor

OauthAuthentication.from(
  1. String userName,
  2. String oauthTokenText, {
  3. String? provider,
})

Creates an OauthAuthentication from the given userName and oauthTokenText in JSON.

Optionally specify the provider for identifying tokens later.

Implementation

factory OauthAuthentication.from(
  String userName,
  String oauthTokenText, {
  String? provider,
}) {
  final token = OauthToken.fromText(oauthTokenText, provider: provider);

  return OauthAuthentication(userName, token);
}