小编Aur*_*tal的帖子

HttpContext.Current.Session为null + OWIN

我是OWIN的新手,这个问题一直是我的主要障碍.

基本上,在我的MVC应用程序中,我在Startup类中有以下内容:

public partial class Startup
{
    public void ConfigureAuth(IAppBuilder app)
    {
        app.SetDefaultSignInAsAuthenticationType(CookieAuthenticationDefaults.AuthenticationType);
        app.UseCookieAuthentication(new CookieAuthenticationOptions());
        app.UseOpenIdConnectAuthentication(
                new OpenIdConnectAuthenticationOptions
                {
                    ClientId = OfficeSettings.ClientId,
                    Authority = OfficeSettings.Authority,

                    TokenValidationParameters = new System.IdentityModel.Tokens.TokenValidationParameters()
                    {
                        RoleClaimType = "roles"
                    },

                    Notifications = new OpenIdConnectAuthenticationNotifications()
                    {

                    AuthorizationCodeReceived = (context) =>
                        {
                        // code hidden for readability

                            if(HttpContext.Current.Session == null)
                            {
                                // It's null. Why is that?
                            }

                            var session = HttpContext.Current.Session;
                            if (session["myMockSession"] != null)
                            {
                                // Do stuff...
                            }
                        },

                        RedirectToIdentityProvider = (context) =>
                        {
                            // …
Run Code Online (Sandbox Code Playgroud)

asp.net authentication session owin

10
推荐指数
1
解决办法
5309
查看次数

错误:(SystemJS)XHR错误(404 Not Found)加载服务

我目前正在尝试使用服务传递字符串.然而,在我的AppComponent我得到undefined服务.

这是错误:

Error: (SystemJS) XHR error (404 Not Found) loading http://localhost:3000/services/main.service
    patchProperty/desc.set/wrapFn@http://localhost:3000/node_modules/zone.js/dist/zone.js:698:26
    ZoneDelegate.prototype.invokeTask@http://localhost:3000/node_modules/zone.js/dist/zone.js:265:21
    Zone.prototype.runTask@http://localhost:3000/node_modules/zone.js/dist/zone.js:154:28
    ZoneTask/this.invoke@http://localhost:3000/node_modules/zone.js/dist/zone.js:335:28

    Error loading http://localhost:3000/services/main.service as "../services/main.service" from http://localhost:3000/app/app.module.js
Stack trace:
(SystemJS) XHR error (404 Not Found) loading http://localhost:3000/services/main.service
    patchProperty/desc.set/wrapFn@http://localhost:3000/node_modules/zone.js/dist/zone.js:698:26
    ZoneDelegate.prototype.invokeTask@http://localhost:3000/node_modules/zone.js/dist/zone.js:265:21
    Zone.prototype.runTask@http://localhost:3000/node_modules/zone.js/dist/zone.js:154:28
    ZoneTask/this.invoke@http://localhost:3000/node_modules/zone.js/dist/zone.js:335:28

    Error loading http://localhost:3000/services/main.service as "../services/main.service" from http://localhost:3000/app/app.module.js
Run Code Online (Sandbox Code Playgroud)

main.service.ts

import { Injectable }                   from '@angular/core';
import { Http, Headers, Response }      from '@angular/http';
import { Observable }                   from 'rxjs/Observable';
import 'rxjs/add/operator/toPromise';
import 'rxjs/add/operator/map';

@Injectable()
export class MainService {
    private projectURL = …
Run Code Online (Sandbox Code Playgroud)

angular

5
推荐指数
1
解决办法
1万
查看次数

使用PAX日志记录时如何摆脱控制台中的日志记录启动消息?

我被要求在我们的RCP应用程序上实现PAX日志记录.基本上,我已经按照本 教程.

您可能已经注意到,它表示当您"运行RCP应用程序时,您应该看到Pax ConfMan日志输出到您的控制台".请注意:可以找到配置文件夹,这不是问题.

当我运行我的应用程序时,我得到以下控制台输出:

[Framework Event Dispatcher] DEBUG org.ops4j.pax.logging.pax-logging-service - BundleEvent STARTED
[Start Level Event Dispatcher] DEBUG org.apache.felix.fileinstall - ServiceEvent REGISTERED
[Start Level Event Dispatcher] DEBUG org.apache.felix.fileinstall - ServiceEvent REGISTERED
[Framework Event Dispatcher] DEBUG org.apache.felix.fileinstall - BundleEvent STARTED
[Start Level Event Dispatcher] DEBUG org.eclipse.equinox.cm - ServiceEvent REGISTERED
[Start Level Event Dispatcher] DEBUG org.eclipse.equinox.cm - ServiceEvent REGISTERED
[Start Level Event Dispatcher] DEBUG org.apache.felix.fileinstall - ServiceEvent REGISTERED
[Framework Event Dispatcher] DEBUG org.eclipse.equinox.cm - BundleEvent STARTED
[org.ops4j.pax.configmanager.internal.Activator] …
Run Code Online (Sandbox Code Playgroud)

rcp logging log4j pax ops4j

2
推荐指数
1
解决办法
790
查看次数

conversationThread和conversation之间有什么区别?

我正在调查文档,我不清楚在Microsoft Graph(v1.0参考)上的conversationThread对话之间究竟有什么区别?

会话文档说明:会话是一组线程,一个线程包含该线程的帖子.对话中的所有主题和帖子都共享相同的主题.关系是线程.在这里,我假设同一主题意味着在那次谈话的保护伞下?

另一方面,conversationThread的文档声明:conversationThread是一组帖子.最后一个帖子的收件人集合是整个帖子的聚合收件人.线程可以拥有越来越多的收件人.从线程中删除收件人时会创建一个新线程.关系是帖子.这里不是一个线索,如果conversationThread是一个帖子的集合,那几乎与会话提供的一样?

我一直想做什么?我正在使用Fiddler来处理HTTP请求groups/<id>/conversations,groups/<id>/threads而且我注意到最明显的区别是threads有一个isLocked属性conversations没有.然后问题出现在我的脑海里:"为什么以及在什么情况下我还会使用group/<id>/threadsgroup/<id>/conversations?".也许是因为我不理解conversationThread会话之间的区别.

请记住,我是Microsoft Graph的新手,如果社区可以帮助我澄清这个问题,我真的很感激.

提前谢谢了!

编辑 使用Fiddler,我们设法创建了一个新线程.但是,不是按预期在指定的对话中创建新线程,而是创建一个新的对话以与新线程一起使用.A还尝试在新创建的线程中创建新帖子,但我面临以下错误:使用请求正文"不支持OData请求":" { "body": { "contentType": "application/json", "content": "This is a test" } }"

microsoft-graph

2
推荐指数
1
解决办法
219
查看次数

标签 统计

angular ×1

asp.net ×1

authentication ×1

log4j ×1

logging ×1

microsoft-graph ×1

ops4j ×1

owin ×1

pax ×1

rcp ×1

session ×1