使用2012年6月的Azure SDK,Visual Studio 2010和IIS Express,我有一个已在127.255.0.2上运行的Web应用程序.我正在使用ACS进行身份验证,我的应用程序被配置为此IP的依赖方.我在我的解决方案中添加了一个新的辅助角色,由于某种原因,这将我的Web应用程序的IP推回到127.255.0.3.这是解决方案中其他地方的第三次更改已经改变了这个IP,我有点厌倦了必须添加新的依赖方设置并重新运行STS向导.
有没有任何正式的方法来控制哪个模拟角色绑定到哪个IP?如果没有,则启动/绑定的顺序与Roles文件夹中的项目顺序相同,如果是,那么调用我的Web角色就像Aardvark一样,确保它始终首先绑定?
如果两个对象相等,如何以最简单的方式检查?我注意到没有方法ExactEqual(),所以我想知道我是否应该手动操作.
谢谢你的帮助!
在派生类中访问a的super值getter似乎不起作用:
class Foo {
private _message:string = "Hello,";
public get Message():string {
return this._message;
}
}
class Bar extends Foo {
public get Message():string {
return super.Message + " World";
}
}
var snafu:Bar = new Bar();
document.write(snafu.Message);
// Expected: "Hello, World"
// Actual: "undefined World"
Run Code Online (Sandbox Code Playgroud)
如何正确覆盖getter并使用该super值?
与由SharePoint支持,如所描述的微风工作在这里,并使用打字稿,而不是JS.
在DataService类中,我创建一个EntityManager并执行一个Query:
private servicePath: string = '/api/PATH/';
private manager: breeze.EntityManager;
constructor() {
this.init();
}
private init(): void {
this.manager = new breeze.EntityManager(this.servicePath);
}
public ListResponses(): breeze.Promise {
var query = breeze.EntityQuery.from("Responses");
return this.manager.executeQuery(query);
}
Run Code Online (Sandbox Code Playgroud)
然后我从我的视图模型中调用它,它工作正常:
private loadResponses(): void {
this.dataservice.ListResponses().then((data) => {
this.handleResponsesLoaded(data);
}).fail((error) => {
this.handleDataError(error);
});
}
private handleResponsesLoaded(data:any): void {
for (var i = 0; i < results.length; i++){
this.extendItem(results[i]);
}
this.renderList(results, "#tp-responses-list");
}
Run Code Online (Sandbox Code Playgroud)
但我尝试扩展每个项目失败,因为该项目entityAspect为null:
private extendItem(item: any): void {
item.entityAspect.propertyChanged.subscribe(() => { …Run Code Online (Sandbox Code Playgroud) 我正在查看Hot Towel模板,并试图让它在TypeScript中工作,我遇到了转换shell viewmodel的问题.我正在尝试将其转换为TS,对我来说更有意义的是它应该是一个类,而不是简单地导出这里所示的函数.我看了这种方法,但是,注意这里的评论,决定不遵循它.
经过一些挖掘后,我找到了这个线程,这表明它应该像重写一样简单router.getActivatableInstance,但我似乎无法远远地调用该函数.
这是我的main.ts(也包括在课堂上):
/// <reference path="dts/toastr.d.ts" />
/// <reference path="dts/durandal.d.ts" />
/// <reference path="dts/require.d.ts" />
import _app = module('durandal/app');
import _system = module('durandal/system');
import _viewLocator = module('durandal/viewLocator');
import _router = module('durandal/plugins/router');
import _logger = module('services/logger');
export class HOPS {
public init(): void {
_logger.log('init', this, 'HOPS', false);
_system.debug(true);
this._startApp();
}
private _startApp(): void {
_logger.log('_startApp', this, 'HOPS', false);
_app.start().then(() => {
toastr.options.positionClass = 'toast-bottom-right';
toastr.options.backgroundpositionClass = …Run Code Online (Sandbox Code Playgroud) 我们有一个使用自定义身份体验框架策略通过 Azure AD B2C 进行保护的 Web 应用程序,允许用户使用社交身份(Microsoft、Google、Facebook)或来自另一个联合 Azure AD 实例的身份或“本地身份”进行注册和登录。 ' 电子邮件/密码帐户。
所有社交帐户和联合 AD 均正常工作。使用电子邮件/密码注册和登录工作正常,但我们现在遇到错误。自从我们最后一次知道电子邮件/密码配置正常工作以来,我们没有故意对我们的电子邮件/密码配置进行任何更改,因此我们不确定这是如何发生的。
问题是:使用新电子邮件地址注册工作正常,并且在该过程完成后,用户正确登录,并且他们的帐户出现在目录中。但是,如果用户注销,则任何重新登录的尝试都会失败:
(显示的电子邮件地址不是实际的。多个用户使用新旧电子邮件/密码组合重复出现错误。)
深入研究门户,发现根本错误如下:
70001 在名为 Y 的租户中找不到名为 X 的应用程序。如果该应用程序尚未由租户管理员安装或未经租户中任何用户同意,则可能会发生这种情况。您可能已将身份验证请求发送给了错误的租户。
此错误有时似乎与未能向门户中的应用程序授予权限有关。我们已尝试删除和恢复所有权限,并重新授予权限。这并没有解决问题。
有谁知道可能导致此问题的原因,特别是为什么注册/登录可以正常工作,但返回登录却不能?
更新:
只是为了确认我们在 AD 目录中配置了 IEF 和代理 IEF 应用程序:

我们login-NonInteractive在 TrustFrameworkExtensions.xml 中配置了技术配置文件:

连接 Application Insights 后(按照这些说明https://learn.microsoft.com/en-us/azure/active-directory-b2c/active-directory-b2c-troubleshoot-custom),我们就能够做到这一点更详细的错误:
AADSTS70001:在 weapageengine.onmicrosoft.com 目录中找不到标识符为“ProxyIdentityExperienceFrameworkAppID”的应用程序
在我们的任何自定义策略中出现的唯一位置“ProxyIdentityExperienceFrameworkAppID”显示在上面的 XML 片段中,但这根据此处的文档似乎是正确的: https: //github.com/Azure-Samples/active-directory-b2c-custom -policy-starterpack/blob/3b4898fec3bf0014b320beffa6eb52ad68eb6111/SocialAndLocalAccounts/TrustFrameworkExtensions.xml#L38 - 除非我们也打算更新这些“DefaultValue”属性?
解决方案: 根据下面的答案,有必要使用相关应用程序 ID 更新元数据和默认值。值得注意的是,在 GitHub 示例https://github.com/Azure-Samples/active-directory-b2c-custom-policy-starterpack/blob/3b4898fec3bf0014b320beffa6eb52ad68eb6111/SocialAndLocalAccounts/TrustFrameworkExtensions.xml#L38中,样板值的大小写不同,导致替换全部中缺少的一个:
active-directory azure azure-active-directory azure-ad-b2c identity-experience-framework
在客户端运行最新的 Blazor 预览版时,我有一个应用程序加载一个IEnumerable<MyClass<T>> data简单的泛型类:
public class MyClass<T>
{
public string ID { get; set; }
public T Value { get; set; }
}
Run Code Online (Sandbox Code Playgroud)
我通过这个IEnumerable喜欢JSRuntime.InvokeAsync这样:
await JSRuntime.InvokeAsync<object>("renderChart", data);
当 T 为 type 时string,这将按预期工作。当 T 为类型double或float失败并出现错误时:
WASM: System.InvalidCastException: Specified cast is not valid.
WASM: at System.Text.Json.ReflectionMemberAccessor+<>c__DisplayClass11_0`2[TClass,TProperty].<CreatePropertyGetter>b__0 (System.Object obj) <0x2951800 + 0x0000c> in <e1cfca862e6a44dbaac6737c11b98f37>:0`
Run Code Online (Sandbox Code Playgroud)
JavaScript 函数只是记录值:
function renderChart(data) {
console.log("Data:", data);
}
Run Code Online (Sandbox Code Playgroud)
这是怎么回事?
使用(最新12.3.0在写作的时候)的NuGet为包Azure.Storage.Blobs与装配,并上传异步BlobServiceClient类,我想在瞬时故障的情况下设定的重试选项。
但是该方法的重载不UploadAsync()接受任何带有重试选项的对象:
UploadAsync(Stream, BlobHttpHeaders, IDictionary<String,String>, BlobRequestConditions, IProgress<Int64>, Nullable<AccessTier>, StorageTransferOptions, CancellationToken)
Run Code Online (Sandbox Code Playgroud)
虽然在创建 a 时BlobServiceClient,可以设置BlobClientOptions,并且这些确实RetryOptions从抽象基类继承了一个字段ClientOptions,但该字段是只读的:
// Summary:
// Gets the client retry options.
public RetryOptions Retry { get; }
Run Code Online (Sandbox Code Playgroud)
如何使用Azure.Storage.Blobs程序集对 Azure blob 存储操作设置重试策略?
我正在尝试使用自定义服务器端登录页面,使用本教程中的代码以及此代码示例,将FederatedAuthentication与.NET 4.5,MVC 4和主动重定向结合在一起.
重定向到我的AccountController的LogOn方法工作正常,方法如下所示:
public ActionResult LogOn()
{
HrdClient hrdClient = new HrdClient();
WSFederationAuthenticationModule fam = FederatedAuthentication.WSFederationAuthenticationModule; /*** Fails here because this is null **/
HrdRequest request = new HrdRequest(fam.Issuer, fam.Realm, context: Request.QueryString["ReturnUrl"]);
IEnumerable<HrdIdentityProvider> hrdIdentityProviders = hrdClient.GetHrdResponse(request);
ViewData["Providers"] = hrdIdentityProviders;
return View();
}
Run Code Online (Sandbox Code Playgroud)
这失败,因为FederatedAuthentication.WSFederationAuthenticationModule是null.
使用VS 2012,我运行了新的Identity and Access向导(它似乎取代了旧的STS对话框).这给了我一个FederationMetadata文件夹,看起来是正确的,并对我的Web.Config进行了一些修改.特别是,模块部分如下所示:
<system.webServer>
<validation validateIntegratedModeConfiguration="false" />
<modules runAllManagedModulesForAllRequests="true">
<add name="WSFederationAuthenticationModule" type="System.IdentityModel.Services.WSFederationAuthenticationModule, System.IdentityModel.Services, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" preCondition="managedHandler" />
<add name="SessionAuthenticationModule" type="System.IdentityModel.Services.SessionAuthenticationModule, System.IdentityModel.Services, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" preCondition="managedHandler" />
</modules>
Run Code Online (Sandbox Code Playgroud)
在看过SO答案 …
我创建了一个安装了TypeScript 0.8.1和Web Essentials的新Windows 8 JavaScript Blank应用程序.
我已经添加了一个文件foo.ts和bar.ts我的项目.
foo.ts 只包含一个简单的类:
class Foo
{ }
Run Code Online (Sandbox Code Playgroud)
bar.ts包含对foo.ts类栏的引用:
/// <reference path="foo.ts" />
class Bar
{ }
Run Code Online (Sandbox Code Playgroud)
奇怪的是,它bar.js包含Bar和Foo类:
var Foo = (function () {
function Foo() { }
return Foo;
})();
var Bar = (function () {
function Bar() { }
return Bar;
})();
Run Code Online (Sandbox Code Playgroud)
出了什么问题?我正在使用共享reference.ts文件处理更大的项目.突然,我的所有ts文件都被编译到每个javascript文件中.
javascript windows-8 visual-studio-2012 typescript web-essentials
javascript ×6
typescript ×5
azure ×3
.net-4.5 ×1
.net-core ×1
asp.net ×1
asp.net-mvc ×1
azure-ad-b2c ×1
blazor ×1
breeze ×1
c# ×1
durandal ×1
edmx ×1
identity-experience-framework ×1
iis-express ×1
inheritance ×1
overriding ×1
sharepoint ×1
wif ×1
windows-8 ×1