﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;

namespace ArmCLR.Biz.User
{
    /// <summary>
    /// 获取登录使用的URL
    /// </summary>
    class OAuth2GetUrlBiz : OAuth2Biz
    {
        public OAuth2GetUrlBiz(BizEnvDA bizEnvDA, OAuth2Asm oauth2Res)
            :base(bizEnvDA, oauth2Res)
        {
        }

        public string GetLoginUrl(string provider, string redirect, string state)
        {
            var prov = _oauth2Res[provider];
            ISocialLogin biz = prov.CreateInstance(_bizEnvDA);
            return biz.AuthorizationUrl(redirect, state);
        }
    }
}
