Beispiel #1
0
        private static async Task <Resp> TenantFormatAndCheck(HttpContext context, AppIdentity appInfo, AppAuthOption appOption)
        {
            if (appInfo.source_mode == AppSourceMode.OutApp ||
                appOption?.TenantProvider == null ||
                CoreTenantContext.Identity != null)
            {
                return(InterReqHelper.SuccessResp);
            }

            var identityRes = await appOption.TenantProvider.GetIdentity(context, appInfo);

            if (!identityRes.IsSuccess())
            {
                return(identityRes);
            }

            CoreTenantContext.SetIdentity(identityRes.data);
            return(identityRes);
        }
Beispiel #2
0
 /// <summary>
 ///  构造函数
 /// </summary>
 public AppAuthAttribute(AppAuthOption appOption) : this()
 {
     _appOption = appOption;
 }