任何人都可以解释或指向我使用SharePoint 2010 Rest API使用Jquery进行更新,删除的示例链接吗?
我有插入工作和当然查询,因为MSDN文档解释和网络上的每个教程解释查询,但只是想知道是否有人插入,更新,删除数据而不是仅查询示例和教程?是的我知道我可以使用CSOM,但我想了解如何通过jquery和sharepoint休息来完成这项工作?
另外,我想使用Merge进行更新.
这是工作插入代码:
function insertMilestone() {
var mileStonesListUrl = "/_vti_bin/listdata.svc/Milestones";
var milestone = {};
milestone.Title = "Testing from REST";
var entry = JSON.stringify(milestone);
$.ajax({
type: "POST",
url: mileStonesListUrl,
data: entry,
contentType: "application/json; charset=utf-8",
error: function (xhr) {
alert(xhr.status + ": " + xhr.statusText);
},
success: function () {
getAll();
}
});
}
Run Code Online (Sandbox Code Playgroud) 在Angular 4中处理隐式流回调的最佳方法是什么?我希望Guard等待用户重定向回来并使用令牌并在Guard返回true或false之前存储它,我在重定向回检查令牌之前已经获得了拒绝访问路由几秒钟.有没有比我正在做的更好的方式来处理AuthGuard,所以在认证完成之前我没有得到拒绝访问?
如何让路由器保护等待重定向?
AppComponent
ngOnInit() {
//if there is a hash then the user is being redirected from the AuthServer with url params
if (window.location.hash && !this.authService.isUserLoggedIn()) {
//check the url hash
this.authService.authorizeCallback();
}
else if (!this.authService.isUserLoggedIn()) {
//try to authorize user if they aren't login
this.authService.tryAuthorize();
}
}
Run Code Online (Sandbox Code Playgroud)
AuthSerivce
tryAuthorize() {
//redirect to open id connect /authorize endpoint
window.location.href = this.authConfigService.getSignInEndpoint();
}
authorizeCallback() {
let hash = window.location.hash.substr(1);
let result: any = hash.split('&').reduce(function (result: any, item: string) {
let …Run Code Online (Sandbox Code Playgroud) 我有一个需要同时使用Anonymous和Windows的AuthorizationProvider,我似乎无法使用windows挑战来使用:
if (principal == null || principal.Identity == null || string.IsNullOrWhiteSpace(principal.Identity.Name))
{
context.OwinContext.Authentication.Challenge();
return Task.FromResult(0);
}
Run Code Online (Sandbox Code Playgroud)
我需要设置任何其他配置值才能使此线路正常工作吗?:context.OwinContext.Authentication.Challenge();
有什么想法,为什么这不起作用?我需要能够获得只在启用Windows的情况下工作正常的Windows主体,但还需要启用匿名以便能够访问提供程序中的其他端点.
实体框架7中的ToListAsync()在哪里.如何在EF 7中使用异步方法返回集合或SingleOrDefault.
public async Task<IEnumerable<TodoItem>> GetAllAsync()
{
//TODO: ToListAsync missing?
return await _context.Todos.ToAsyncEnumerable();
}
Run Code Online (Sandbox Code Playgroud)
这是返回错误,不包含GetAwaiter的定义?SaveChangesAsync没问题.
我买了一个Angular 4模板主要是为了看看布局是如何完成的,但包括工作组件,我注意到他们在app组件中有一堆设置,主要用于菜单,改变样式,主要是控制外部框架.
在菜单组件和其他一些组件中,他们使用以下内容与AppComponent设置进行通信:
constructor(@Inject(forwardRef(() => AppComponent)) public app:AppComponent) {}
Run Code Online (Sandbox Code Playgroud)
并将在菜单组件中调用类似:this.app.darkMenu = true的内容
这是有效的设计,好的,坏的,过时的?我甚至不知道你可以像这样与App或父组件通信?这应该是一个Observable Subject或EventEmitter,还是可以通过forwardRef进行通信?这似乎与.NET类似,我可以使用this.master.whateverproperty与MasterPage进行通信.
我喜欢forwardRef如何工作,但不确定我是否应该使用它或更改它以不同的方式进行通信?
有没有人有一个使用net.tcp和已发布令牌的消息安全模式的当前示例.我目前有一个安全令牌服务,它发出令牌,但不知道如何使用net.tcp配置它.我只看到使用ws2007FederationHttpBinding的例子
<customBinding>
<binding name="wsFed">
<security authenticationMode="SecureConversation" requireSecurityContextCancellation="true">
<secureConversationBootstrap authenticationMode="IssuedToken">
<issuedTokenParameters tokenType="http://docs.oasis-open.org/wss/oasis-wss-saml-token-profile-1.1#SAMLV1.1">
<issuer address="http://localhost/STSWebHost/STSService.svc" binding="ws2007HttpBinding" />
</issuedTokenParameters>
</secureConversationBootstrap>
</security>
<tcpTransport />
</binding>
</customBinding>
Run Code Online (Sandbox Code Playgroud)
我一直得到Crypto算法不支持错误?使用ws2007FederationHttpBinding工作正常,但我需要使用net.tcp.任何人?
谁能告诉我为什么这不适用于整数但适用于字符?我真的很讨厌 reg 表达式,因为它们很神秘,但如果我也有的话。我还想在有效字符中包含“-()”。
String.prototype.Contains = function (str) {
return this.indexOf(str) != -1;
};
var validChars = '0123456789';
var str = $("#textbox1").val().toString();
if (str.Contains(validChars)) {
alert("found");
} else {
alert("not found");
}
Run Code Online (Sandbox Code Playgroud) 我试图了解使用 WCF、Claims 和 ADFS 3.0 开发框架需要什么。内部用户将根据 Active Directory 进行身份验证,外部用户将根据 SQL Server 表进行身份验证,并且授权存储在实现组和权限的数据库表中。我正在使用 WCF 而不是 Web Api 或 OWIN 创建 API。
我对使用 Identity Server 或 3rd 方产品不感兴趣,我只想知道如何创建自定义安全令牌服务以从我的成员资格表中读取并通过我的组和权限表设置声明。
我找不到任何有关此的信息。Visual Studio 2015 中没有身份和访问控制,似乎没有使用 WCF,只使用 Web Api、OWIN 和 MVC?
我正在寻找有关如何使用Angular 2和Identity Server 4最好地处理令牌过期的建议.我正在使用Identity Server 4的隐式流程,它不会发出刷新令牌,我不想重定向令牌过期后的用户.
另外,为什么没有刷新令牌?为什么混合流不适用于javascript客户端?我控制ID服务器,应用程序和api所以这会工作吗?
angular ×3
.net ×2
c# ×2
wcf ×2
adfs ×1
asp.net ×1
asp.net-mvc ×1
claims ×1
identity ×1
javascript ×1
jquery ×1
oauth ×1
primeng ×1
sharepoint ×1
wif ×1