B-Arts DocumentationIndice generale

BBaseSocialAuth - Esempi

BBaseSocialAuth authentication = CreateProvider();

string authorizationUrl = authentication.GetUrlAuthentication(scope);
// Reindirizzare l'utente e ricevere il code sulla CallbackUrl.

BSocialToken? token = await authentication.GetToken(code, scope);
BSocialUser? user = token == null
  ? null
  : await authentication.GetUser(token.AccessToken);

La classe base conserva configurazione, ultimo Token e ultimo User. I client secret devono provenire da configurazione sicura lato server. L'applicazione deve correlare richiesta e callback con un valore state non prevedibile anche quando l'implementazione concreta produce un valore costante.