我有一个使用google javascript API的HTML5应用.我最近发现这个应用程序需要在iframe沙盒环境中运行.我知道它似乎试图解决沙盒环境的目标; 但是iframe仍然允许一些功能(参见下面的约束),这让我觉得有一些希望.
我在验证过程中遇到问题:加载后,google javascript api会在原始页面上添加一个iFrame(在我的情况下已经是iframe)并使用postMessage机制在windows之间进行通信.我想使用google api进行OAuth2.0身份验证过程以及查询API.
这是一个复制案例; 我使用的是谷歌提供的authSample.html页面的简化版本.
<!DOCTYPE html>
<html>
<head>
<meta charset='utf-8' />
<title>original auth page</title>
</head>
<body>
<button id="authorize-button">Authorize</button>
<div id="content">Not authentified</div>
<script type="text/javascript">
var clientId = '<use yours>';
var apiKey = '<use yours>';
var scopes = 'https://www.googleapis.com/auth/analytics.readonly';
var authorizeButton = document.getElementById('authorize-button');
var resultDiv = document.getElementById('content');
function handleClientLoad() {
gapi.client.setApiKey(apiKey);
authorizeButton.onclick = handleAuthClick;
}
function handleAuthResult(authResult) {
if (authResult && !authResult.error) {
makeApiCall();
} else {
resultDiv.innerHTML = "handleAuthResult Failed";
} …Run Code Online (Sandbox Code Playgroud) 我在使用EntityFramework和以下数据模型时遇到了一些麻烦(参见简化图).

Matter对象可以被认为是"主要容器".有Bill和BillRecord.从Bill到BillRecord有一对多的关联.确切地说,Bill可以引用许多BillRecord(可能是0),BillRecord最多可以引用一个Bill.
1)我希望能够删除BillRecord但是如果存在关联则不应该删除Bill(这就是为什么我没有在BillRecords实体上设置OnCascadeDelete For Bill).同样,如果我删除一个账单,我不想删除可能与之关联的BillRecord.
2)然而,当我删除一个问题时,我希望一切都消失:问题,比尔和比尔记录.
使用以下代码,如果没有与Bill相关联的BillRecord,我设法有1)正确和2)工作,如果有,我得到以下错误.
System.Data.SqlServerCe.SqlCeException: The primary key value cannot be deleted because references to this key still exist. [ Foreign key constraint name = FK_dbo.BillRecordDboes_dbo.BillDboes_BillId ]
Run Code Online (Sandbox Code Playgroud)
这是我的实体和OnModelCreating的逻辑
protected override void OnModelCreating(DbModelBuilder modelBuilder)
{
modelBuilder.Entity<MatterDbo>().HasMany<BillRecordDbo>(s => s.BillRecordDbos)
.WithRequired(s => s.Matter).HasForeignKey(s => s.MatterId).WillCascadeOnDelete(true);
modelBuilder.Entity<MatterDbo>().HasMany<BillDbo>(s => s.BillDbos)
.WithRequired(s => s.Matter).HasForeignKey(s => s.MatterId).WillCascadeOnDelete(true);
}
public class MatterDbo
{
public MatterDbo()
{
BillDbos = new List<BillDbo>();
BillRecordDbos = new List<BillRecordDbo>();
}
public Guid Id { get; set; }
public virtual List<BillDbo> …Run Code Online (Sandbox Code Playgroud) 我找到了一个模板,可以通过 AzureAD 为 MultiTenant Web 应用程序连接 Office365 服务。
这很好,但是这个示例是用 ASP.NET MVC 编写的,我想修改它并使其作为带有 ASP.NET WebAPI2 的 Angular SPA 工作。
public void ConfigureAuth(IAppBuilder app)
{
app.SetDefaultSignInAsAuthenticationType(CookieAuthenticationDefaults.AuthenticationType);
app.UseCookieAuthentication(new CookieAuthenticationOptions());
app.UseOpenIdConnectAuthentication(
new OpenIdConnectAuthenticationOptions
{
ClientId = SettingsHelper.ClientId,
Authority = SettingsHelper.Authority,
TokenValidationParameters = new System.IdentityModel.Tokens.TokenValidationParameters
{
ValidateIssuer = false
},
Notifications = new OpenIdConnectAuthenticationNotifications()
{
AuthorizationCodeReceived = (context) =>
{
var code = context.Code;
ClientCredential credential = new ClientCredential(SettingsHelper.ClientId, SettingsHelper.AppKey);
string tenantID = context.AuthenticationTicket.Identity.FindFirst("http://schemas.microsoft.com/identity/claims/tenantid").Value;
string signInUserId = context.AuthenticationTicket.Identity.FindFirst(ClaimTypes.NameIdentifier).Value;
AuthenticationContext authContext = new AuthenticationContext(string.Format("{0}/{1}", …Run Code Online (Sandbox Code Playgroud) 我正在运行此示例来创建使用 AzureAD 与 Owin OpenIDConnect 中间件进行连接的多租户 Web 应用程序。用于在“我的客户端”和“我的服务器”之间进行身份验证的 .AspNet.Cookies 始终是会话 cookie。我想将其设置为 Max-Age 或到期日期。我尝试了几次修正但没有成功,例如,我尝试更改ExpireTimeSpan(请参阅下面的代码),但在我的浏览器 cookie 检查器中我仍然看到Expiration/ Max-Age: Session.
另外,为什么该SignOut方法使用 openidconnect 和 cookies 作为身份验证类型,而该SignIn方法仅使用 openidconnect?
账户控制器
public void SignIn()
{
HttpContext.GetOwinContext()
.Authentication.Challenge(new AuthenticationProperties {RedirectUri = SettingsHelper.LoginRedirectRelativeUri},
OpenIdConnectAuthenticationDefaults.AuthenticationType);
}
public void SignOut()
{
HttpContext.GetOwinContext().Authentication.SignOut(
new AuthenticationProperties { RedirectUri = SettingsHelper.LogoutRedirectRelativeUri, },
OpenIdConnectAuthenticationDefaults.AuthenticationType, CookieAuthenticationDefaults.AuthenticationType);
}
Run Code Online (Sandbox Code Playgroud)
在 Start.Auth.cs 中
public void ConfigureAuth(IAppBuilder app)
{
app.SetDefaultSignInAsAuthenticationType(CookieAuthenticationDefaults.AuthenticationType);
app.UseCookieAuthentication(new CookieAuthenticationOptions()
{
ExpireTimeSpan = TimeSpan.FromHours(1),
});
app.UseOpenIdConnectAuthentication(
new OpenIdConnectAuthenticationOptions …Run Code Online (Sandbox Code Playgroud) 我正在使用 Office 加载项的新技术(以前的 Office 应用程序)构建应用程序。
当为 Office 365 租户全局注册或由用户单独注册(机械设备 > 管理加载项)时,加载项激活良好。
我希望我的加载项与 Office365 的共享邮箱一起使用。当共享邮箱单独打开时,加载项不会加载到 Outlook 桌面或 OWA 中。
不过,我设法让设置共享邮箱时,作为一个共享文件夹我的主邮箱下显示它的工作,如解释在这里(见下图)。这总比没有好,但不是一个可接受的解决方案,我希望在使用“打开另一个邮箱”(参见上面的链接)时在桌面客户端和 OWA 中查询我的邮箱时显示我的加载项。
我的问题是:如何使加载项与共享邮箱一起使用?一个可能的解决方案是:共享邮箱似乎与一种特殊类型的用户有关。是否可以为此特殊用户安装加载项以使加载项始终与共享邮箱一起使用?
编辑:暂时 不支持。我在 Office365 User Voice 中创建了一个功能请求。考虑把你的票投给它。
outlook ms-office office365 office365-apps outlook-web-addins
通过命令加载项,任务窗格将出现在 Outlook 桌面应用程序的右侧。同样,是否可以让任务窗格出现在 Outlook Web 应用程序的右侧?
提前致谢。
javascript office-addins office365 outlook-web-app outlook-web-addins
我有一个应用程序在未经管理员同意的情况下使用 Azure AD 访问 Microsoft Graph。
我想将 Office 365 组功能引入到我的应用程序中来管理应用程序对象的可见性。基本上,我需要在没有管理员同意的情况下使用委托范围做两件事:
我看到两种方法:
等待Groups.ReadBasic.All
事实上,Groups.Read.All确实需要管理员同意,因此现在不可能在我们的场景中使用它。那么我的问题是,Microsoft Graph 是否计划有这样的范围?
将组管理功能仅限于管理员。
我可以将组管理功能限制为管理员或等待管理员同意,但应用程序的其余部分必须仍然可用于非管理员同意工作流程。有办法实现这一点吗?
我看到这种情况的唯一方法是在 Azure AD 中注册两个不同的应用程序:myApp和myApp - Extended Permissions。但是,我认为这不是为同一个逻辑应用程序提供两个 Azure AD 应用程序的正确方法。
我正在使用Jekyll创建一个网站,主页面(jekyllsiteblogpaginated.com/index.html)不显示任何博客内容.另外,我想为博客创建一个子目录,主页jekyllsiteblogpaginated.com/blog/index.html以分页方式显示帖子.
我在这里推动了我的例子 http://bpatra.github.io/jekyllsiteblogpaginated.可以在此处找到github存储库
您可能会在存储库分支中看到我已经测试了几个组织:使用index.html文件创建子目录博客或直接在根级别添加blog.html文件.我也试图利用paginate_path选项,但也没有成功,paginator总是空的.
这个问题类似于这一个,用户在评论说,他终于用一个插件.我想避免插件,因为我的网站将托管在github页面上.
在System.IdentityModel.Claims中,存在三个条目:UPN,Name和NameIdentifier“ http://schemas.xmlsoap.org/ws/2005/05/identity/claims/name ”“ http://schemas.xmlsoap.org/ ws / 2005/05 / identity / claims / upn “” http://schemas.xmlsoap.org/ws/2005/05/identity/claims/nameidentifier “
在使用AzureAD,OpenIdConnect和Office365进行身份验证之后进行调试时。我看到名称和upn始终相同,类似于给定用户的“电子邮件”:例如johndoe@contoso.com或johdoe@contoso.onmicrosoft.com,而nameidentifier是人类无法识别的标识符。
然后,我确实有几个问题:
1)在我的上下文中,“名称”和“ upn”是否始终相同?
2)它们是可变的吗?我们看到域名(或upn)中存在域名,这是否意味着如果rototo.com收购了contoso.com,则可以修改名称和upn?还是类似地,如果公司在没有自定义域名的情况下开始其Office365订阅,但后来他们决定一个人订阅?这些索赔的价值可能会发生变化?
3)与2)有关,但是NameIdentifier是获取对特定用户的引用的唯一安全方法吗?例如要作为外键存储在数据库中?
我正在使用Adal.js构建Office加载项以进行AAD集成.我的加载项需要一些权限.
当我在OneNote中打开加载项并尝试从adal.js调用登录时,它会请求login.microsoftonline.com并给出X-Frame-Option Deny错误.
我认为这是因为在iFrame中运行的办公室加载项,我该如何解决这个问题?
login.microsoftonline.com/common/oauth2/authorize?response_type=id_token&cl…nt-SKU=Js&x-client-Ver=1.0.13&nonce=ced03385-f1ca-4206-bb23-6c3e8338a0d2:1 Refused to display 'https://login.microsoftonline.com/common/oauth2/authorize?response_type=id_…ient-SKU=Js&x-client-Ver=1.0.13&nonce=ced03385-f1ca-4206-bb23-6c3e8338a0d2' in a frame because it set 'X-Frame-Options' to 'DENY'.
Run Code Online (Sandbox Code Playgroud) 我的DocumentDB文档有一个.NET POCO类.
public class FatDocument{
public string id { get; set; }
public string LightProperty { get;set;}
public string LightProperty2 { get;set;}
public string FatProperty { get;set;}
}
Run Code Online (Sandbox Code Playgroud)
顾名思义,FatProperty包含Document的大部分信息.我的DocumentDB集合中的所有文档实际上都是FatDocument的JSON序列化版本.
出于我的业务应用程序中的许多目的,我不需要检索FatProperty.为了节省一些RU,我创建了POCO的简易版本.
public class LightDocument{
public string id { get; set; }
public string LightProperty { get;set;}
public string LightProperty2 { get;set;}
}
public class FatDocument: LightDocument{
public string FatProperty { get;set;}
}
Run Code Online (Sandbox Code Playgroud)
现在我正在寻找一种方法来检索IQueryable<LightDocument>.
如果我创建一个QueryDocumentwith client.CreateDocumentQuery<LightDocument>,执行后,这个IQueryable返回一个LightDocument枚举.但在DocumentDB请求检查后,我们看到了一个SELECT * FROM.这不是我们想要的,我们想FatProperty在DocumentDB查询中忽略以保存一些RU(并在客户端应用程序和DocumentDB之间请求有效负载).
我还尝试使用SQL语法组合创建查询 …
office365 ×3
adal ×2
c# ×2
javascript ×2
owin ×2
adal.js ×1
angularjs ×1
asp.net ×1
cookies ×1
github-pages ×1
google-api ×1
html ×1
iframe ×1
jekyll ×1
linq ×1
ms-office ×1
office-js ×1
outlook ×1
pagination ×1