mirror of
https://gitee.com/dotnetchina/OpenAuth.Net.git
synced 2025-09-19 18:22:11 +08:00
转移.net core 3.1,为.NET 5做准备
This commit is contained in:
36
OpenAuth.App/Interface/IAuth.cs
Normal file
36
OpenAuth.App/Interface/IAuth.cs
Normal file
@@ -0,0 +1,36 @@
|
||||
/*
|
||||
*单独提取这个接口,为了以下几点:
|
||||
* 1、可以方便的实现webapi 和本地登录相互切换
|
||||
* 2、可以方便的使用mock进行单元测试
|
||||
*/
|
||||
|
||||
using OpenAuth.App.SSO;
|
||||
|
||||
namespace OpenAuth.App.Interface
|
||||
{
|
||||
public interface IAuth
|
||||
{
|
||||
/// <summary>
|
||||
/// 检验token是否有效
|
||||
/// </summary>
|
||||
/// <param name="token">token值</param>
|
||||
/// <param name="otherInfo"></param>
|
||||
/// <returns></returns>
|
||||
bool CheckLogin(string token="", string otherInfo = "");
|
||||
AuthStrategyContext GetCurrentUser();
|
||||
string GetUserName(string otherInfo = "");
|
||||
/// <summary>
|
||||
/// 登录接口
|
||||
/// </summary>
|
||||
/// <param name="appKey">登录的应用appkey</param>
|
||||
/// <param name="username">用户名</param>
|
||||
/// <param name="pwd">密码</param>
|
||||
/// <returns></returns>
|
||||
LoginResult Login(string appKey, string username, string pwd);
|
||||
/// <summary>
|
||||
/// 退出登录
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
bool Logout();
|
||||
}
|
||||
}
|
50
OpenAuth.App/Interface/IAuthStrategy.cs
Normal file
50
OpenAuth.App/Interface/IAuthStrategy.cs
Normal file
@@ -0,0 +1,50 @@
|
||||
// ***********************************************************************
|
||||
// Assembly : OpenAuth.App
|
||||
// Author : 李玉宝
|
||||
// Created : 07-05-2018
|
||||
//
|
||||
// Last Modified By : 李玉宝
|
||||
// Last Modified On : 07-05-2018
|
||||
// ***********************************************************************
|
||||
// <copyright file="IAuthStrategy.cs" company="OpenAuth.App">
|
||||
// Copyright (c) http://www.openauth.me. All rights reserved.
|
||||
// </copyright>
|
||||
// <summary>
|
||||
// 授权策略接口
|
||||
// </summary>
|
||||
// ***********************************************************************
|
||||
|
||||
|
||||
using System.Collections.Generic;
|
||||
using Infrastructure;
|
||||
using OpenAuth.App.Response;
|
||||
using OpenAuth.Repository.Domain;
|
||||
|
||||
namespace OpenAuth.App
|
||||
{
|
||||
public interface IAuthStrategy
|
||||
{
|
||||
List<ModuleView> Modules { get; }
|
||||
|
||||
List<ModuleElement> ModuleElements { get; }
|
||||
|
||||
List<Role> Roles { get; }
|
||||
|
||||
List<Resource> Resources { get; }
|
||||
|
||||
List<Org> Orgs { get; }
|
||||
|
||||
User User
|
||||
{
|
||||
get;set;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据模块id获取可访问的模块字段
|
||||
/// </summary>
|
||||
/// <param name="moduleCode"></param>
|
||||
/// <returns></returns>
|
||||
List<KeyDescription> GetProperties(string moduleCode);
|
||||
|
||||
}
|
||||
}
|
7
OpenAuth.App/Interface/ICustomerForm.cs
Normal file
7
OpenAuth.App/Interface/ICustomerForm.cs
Normal file
@@ -0,0 +1,7 @@
|
||||
namespace OpenAuth.App.Interface
|
||||
{
|
||||
public interface ICustomerForm
|
||||
{
|
||||
void Add(string flowInstanceId, string frmData);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user