- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在查看几个使用 ACS 的示例,显然它们确实让我感到愚蠢。
我在线查看了教程,似乎我所需要的只是配置中的以下行:
httpRuntime requestValidationMode="2.0"
但是此 sample project 中还有一些其他示例SimpleMVC4 的配置中没有这样的行。更糟糕的是,我没有看到任何引用 ACS 库的内容,无论它是什么。
另一方面,MVC3 示例有一堆乱码,包括对 javascript 的 ajax 请求,嗯!?
public const string HrdPath = "v2/metadata/IdentityProviders.js";
/// <summary>
/// Gets the url with its query string representing this request
/// </summary>
/// <returns></returns>
public string GetUrlWithQueryString()
{
uriBuilder.Path = HrdPath;
uriBuilder.Query = parameters.ToQueryString();
return uriBuilder.Uri.AbsoluteUri;
}
在 Raxor View 中
$("#signIn").click(function () {
//
// Explicit JSONP callback can be used to do client side caching of identity provider data.
//
$.ajax({
url: "@Html.Raw(Model.GetUrlWithQueryString())",
dataType: "jsonp",
哈!?
看看我能得到一些简单的(白痴证明)指针吗?
最佳答案
我最近也经历过类似的痛苦。我对此完全是新手,很难理解这一切。我发现Pluralsight Courses from Dominick Baier对于理解这些概念非常有用。
现在回答你的问题。
I have got an MVC controller action, I want to tell users here are the Identity Providers (IP) that they can use, and their respective URLs as well as generating the tokens that will be verified in step (3), below. How do I get to this in a C# code?
请查看这篇博客文章,了解如何在您端创建登录页面:https://www.simple-talk.com/cloud/development/creating-a-custom-login-page-for-federated-authentication-with-windows-azure-acs/
Once, the client, ACS, IP are done with their business, I don't care what that is, as far as I'm concerned all those is between the client, ACS and the IP. I should get another request from the user. What do I do with this request? How do I verify if the user is kosher? And that they did not falsify the token from step (2) above.
我认为您不需要在这里做任何特别的事情。 ASP.Net 管道通过将 Principal
的 IsAuthenticated
属性设置为 true 来为您处理此问题。这是我的代码当前的样子(主要取自上面的博客文章)。对我来说,整个应用程序都受到保护,默认情况下用户会登录主页。我检查用户是否经过身份验证。如果他们未经过身份验证,我会向他们显示 ACS 中配置的所有身份提供程序,并且用户可以使用其中任何一个身份提供程序登录。身份验证成功后,ACS 会将用户发送回同一页面,这次用户已通过身份验证。在我的代码中,如果用户经过身份验证,我会执行应用程序所需的一系列声明转换。
Controller
public ActionResult Index()
{
if (!ClaimsPrincipal.Current.Identity.IsAuthenticated)
{
var idpsUrl = "IdentityProvidersUrl Taken from ACS Login Page";
var webClient = new WebClient()
{
Encoding = Encoding.UTF8,
};
var jsonList = webClient.DownloadString(idpsUrl);
var acsResult = JsonConvert.DeserializeObject<List<IdentityProvider>>(jsonList);
return View(acsResult);
}
else
{
var principal = ClaimsPrincipal.Current;
var claims = principal.Claims;
//If any claims transformation needs to be done, that can be done here.
}
}
查看
@{
ViewBag.Title = "Index";
}
<h2>Index</h2>
@foreach (var p in Model)
{
<p>
<a href="@p.LoginUrl">@p.ToString()</a>
</p>
}
型号
public class IdentityProvider
{
public List<string> EmailAddressSuffixes { get; set; }
public string ImageUrl { get; set; }
public string LoginUrl { get; set; }
public string LogoutUrl { get; set; }
public string Name { get; set; }
public override string ToString()
{
return Name;
}
}
关于asp.net - 在 C# 中设置 Azure ACS,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17078929/
谁能给我解释一下 AC-1、AC-2 和 AC-3 算法?我必须理解它们并用代码实现它们。但首先,我想很好地理解它们,但它们太难了,我无法理解。有什么帮助吗?顺便说一句,我对回溯不太熟悉,我试着阅读和
ACS.exe是什么进程? Acs.exe是Windows操作系统中的一个可执行文件(程序),文件的扩展名是.exe的表示是可执行。请务必运行那些您信任的可执行文件,因为可执行文件存在潜在的风险,
我将自定义 STS 用作 IDP,并使用 Azure ACS 和 WCF 服务作为 RP。 我在获取 ACS token 时收到以下错误 - ACS10002:处理 SOAP 正文时发生错误。 ACS
我试图理解这两种算法,但找不到它们之间的区别。 http://en.wikipedia.org/wiki/AC-3_algorithm 最佳答案 您说得对,两种算法都具有相同的迭代到定点结构。不同之处
即使我提供了正确的管理服务 key ,我也会收到错误 error ID 1113 The specified acs service namespace ' xyz 'and management k
Azure 培训套件包括一个名为“IntroToACS2”的实验室。您可以在其中创建一个 WebRole 并启用 ACS,以便您可以使用您的 Google、Live 或 Yahoo id 登录。本实验
这个问题在这里已经有了答案: 关闭 10 年前。 Possible Duplicate: How many styles of writing functions are there in C? 我
最近在看GSM音频编码的源码。这些代码是在 1992 年或之后编写的。 有一些奇怪的代码,例如: main P2((ac, av), int ac, char ** av) void Gsm_Code
我需要急性选择。我已经提到了这个enter link description here 添加所有这些依赖项后控制台出现错误 MainPage.html Error ac-options and ac
我有一个 ACS 命名空间,并设置了 WS-Federation 身份提供程序。由于我使用的是 Visual Studio 2012,因此我使用身份和访问工具来创建依赖方。该工具使用领域并返回我在创建
我一直在研究 Azure 访问控制服务 (ACS),它看起来特别擅长处理来自异构(可配置)身份提供商的身份验证。然后,它似乎支持许多其他场景(例如,参见 ACS How-To's )。 我的问题恰恰相
首先,让我陈述我的真正问题:我有调用 ACS 管理服务的代码,并且我希望我的集成测试能够同时运行,而无需每次测试运行击败其他人。也就是说,由于多人/构建服务器最终可能会同时运行这些测试,如果他们都使用
我知道有很多关于 Azure ACS 的问题,但我想问一个更普遍的问题: 我应该使用 ACS,还是不值得付出努力? :) 我想要的是 Azure 中的安全 WebService,它将从 2 个位置调用
我正在构建一个 Azure 托管的 WCF 服务,我希望使用存储在 SQL Server 数据库中的凭据通过 ACS 来保护该服务。我已经查看了一堆 ADFS2 示例,但尚未弄清楚如何做到这一点。我确
我正在基于 Thinktecture 代码实现我自己的身份提供程序。这是使用单点注销功能时 Azure ACS 的奇怪行为,它对于 google/live 和我自己的身份提供商有所不同。 注销 URL
简单的单点登录问题 我有两个 MVC4 应用程序: **1**- http://localhost/BikeShop ACS Relying Party: - Name: **Bik
简单的问题 - 我们是否可以使用 PowerShell(或其他命令行工具)以编程方式配置 ACS?看起来 PowerShell cmdlet 的旧 CodePlex 版本支持此功能,但后来的官方版本似
我正在使用 Azure ACS 并将其合并到我的 .NET 4.0 网站的 SSO 策略中。我在规则组页面上看到可以存储一堆不同的声明并将其传递回 RP(例如国家/地区、街道地址、电话等)。看起来您还
在我的代码下面但它不起作用 - 请参阅 this screenshot of the error during debugging , Cannot find local variable 'ac'
我已经使用以下方法解决了 CSP 问题: 运行 AC3 以减少可变域 使用简单的回溯寻找解决方案。 它对我所有的测试用例都运行得非常好而且速度很快,但是我的一个 friend 问我这个问题:“如果最初
我是一名优秀的程序员,十分优秀!