在Android上有相当于iOS的钥匙串吗?
我对Preferences API的理解是它没有加密.对于我的应用程序而言,这些凭据是否跨设备持久存在并不重要(例如Android中的类似iPhone的Keychain的不同用例?)
我还查看了KeyStore API,但它似乎将用户凭据的实际存储留给了应用程序开发人员.
谢谢你的帮助!
是否有可能(如果是,如何?)配置自托管owin端点以使用A/D的客户端证书映射身份验证?IIS具有此功能链接,但到目前为止,我还没有找到自托管端点的等效项.
尽管如此(考虑到这种方法可能不是100%万无一失),我可以通过使用authenticationSchemeSelectorDelegate和OWIN的组合来完成两个步骤.
这将选择适当的AuthenticationScheme(允许包含证书的请求,否则推迟到NTLM身份验证)
public void Configuration(IAppBuilder appBuilder)
{
var listener = (HttpListener)appBuilder.Properties[typeof(HttpListener).FullName];
listener.AuthenticationSchemeSelectorDelegate += AuthenticationSchemeSelectorDelegate;
}
private AuthenticationSchemes AuthenticationSchemeSelectorDelegate(HttpListenerRequest httpRequest)
{
if (!httpRequest.IsSecureConnection) return AuthenticationSchemes.Ntlm;
var clientCert = httpRequest.GetClientCertificate();
if (clientCert == null) return AuthenticationSchemes.Ntlm;
else return AuthenticationSchemes.Anonymous;
}
Run Code Online (Sandbox Code Playgroud)
这将读取cert的内容并相应地填充"server.User"环境变量
public class CertificateAuthenticator
{
readonly Func<IDictionary<string, object>, Task> _appFunc;
public CertificateAuthenticator(Func<IDictionary<string, object>, Task> appFunc)
{
_appFunc = appFunc;
}
public Task Invoke(IDictionary<string, object> environment)
{
// Are we authenticated already (NTLM)
var user = environment["server.User"] as IPrincipal;
if …Run Code Online (Sandbox Code Playgroud)