IOAuthService.cs•1.25 kB
using System.Collections.Generic;
using System.Threading.Tasks;
using Api.DigitalPages.Interfaces.Services.OAuthData;
namespace Api.DigitalPages.Interfaces.Services
{
public interface IOAuthService
{
Task<string> AccessCodeUrl(OAuthProvider provider, string clientId, string redirectUri, string state, string scopes = "email");
Task<string> AccessCodeUrl(OAuthProvider provider, string clientId, string redirectUri, string state, string tenant, string scopes = "email");
Task<IOAuthUser> UserInfo(OAuthProvider provider, IOAuthAccessToken accessToken);
Task<T> UserInfo<T>(OAuthProvider provider, IOAuthAccessToken accessToken) where T : IOAuthUser;
Task<IOAuthCodeCallback> AccessCodeFromCallback(Dictionary<string,object> request);
Task<IOAuthAccessToken> AccessToken(OAuthProvider provider, string accessCode, string clientId, string clientSecret, string redirectUri);
Task<IOAuthAccessToken> AccessToken(OAuthProvider provider, string accessCode, string clientId, string clientSecret, string redirectUri, string tenant);
}
public enum OAuthProvider
{
Undefined,
Facebook,
Google,
Microsoft
}
}