내 응용 프로그램과 함께 로그인하려고하면 큰 성능 문제가 있습니다. 이 응용 프로그램은 Azure에서 호스팅되는 웹 API 응용 프로그램입니다. 내 프런트 엔드에 반응하는 js를 사용합니다.OWIN 로그인 느린 성능> 30 초
그리고 내 SimpleAuthorizationProvider에서 사용자를 가져오고 ClaimsIdentity 속성에 클레임을 추가합니다. 내가 로컬로 디버깅하는 경우 처음 로그인했을 때 속도가 느린 문제가 있지만 다음에 로그인 할 때 인스턴트 액세스 만 가능합니다. Azure에서 테스트 환경에 업로드하면 모든 요청에 문제가 있습니다.
웹 응용 프로그램의 Azure에서 "항상 켜기"속성을 켰습니다. 내가 요청을 초과하고 시간이 많이 걸리는 것은 그냥 사용자에게 권한을 부여하는 내 테스트 환경에서 15 SEK 소요 SimpleAuthorizationprovider
context.Validated(ticket);
코드의이 작품이다. 내 프런트 엔드에도 약간의 지연이있을 수 있습니다. 내 프런트 엔드에서 우리는 웹 API에 요청을하기 위해 superagent를 사용하고 있습니다.
여기 내 시작 클래스 내 구성입니다 :
public void Configuration(IAppBuilder app)
{
app.UseCors(CorsOptions.AllowAll);
ConfigureOAuth(app);
var physicalFileSystem = new PhysicalFileSystem(@"./Html");
var options = new FileServerOptions
{
EnableDefaultFiles = true,
FileSystem = physicalFileSystem,
StaticFileOptions =
{
FileSystem = physicalFileSystem,
ServeUnknownFileTypes = true
},
DefaultFilesOptions = {DefaultFileNames = new[] {"Startup.html"}}
};
app.UseFileServer(options);
// Get your HttpConfiguration.
var config = GetInjectionConfiguration();
config.MessageHandlers.Add(new QueryStringBearerToken());
WebApiConfig.Register(config);
// Setup WebApi
app.UseWebApi(config);
SetupWebApi(config);
Application_Start(config);
config.EnsureInitialized();
}
public void ConfigureOAuth(IAppBuilder app)
{
var oAuthServerOptions = new OAuthAuthorizationServerOptions
{
TokenEndpointPath = new PathString("/api/token"),
AuthorizeEndpointPath = new PathString("/Login"),
AccessTokenExpireTimeSpan = TimeSpan.FromMinutes(120),
Provider = new SimpleAuthorizationServerProvider(),
RefreshTokenProvider = new ApplicationRefreshTokenProvider(),
AllowInsecureHttp = true,
};
var oAuthBearerOptions = new OAuthBearerAuthenticationOptions
{
Provider = new QueryStringOAuthBearerProvider(),
AccessTokenProvider = new AuthenticationTokenProvider(),
};
app.UseOAuthBearerAuthentication(oAuthBearerOptions);
app.UseOAuthAuthorizationServer(oAuthServerOptions);
}
편집 :
내가 지금 context.validated (티켓) 문제가 아니라고 말할 수있다. Azure에서 응용 프로그램 통찰력을 연결하여 거기에서 더 유용한 정보를 얻을 수 있는지 확인했습니다. 내 생각 엔 요청이 안타되기 전에 API 프로세스가 "예열되지"않았기 때문에 프로세스가 매번 향상되어야한다는 결과가 여전히 있습니다. 로컬로 디버깅 할 때 내 토큰 끝점에 도달하는 첫 번째 요청에 대해 약 10 초가 걸립니다. 그 요구 후에 나는 또 하나를 보냈고 모든 것이 예상대로 작동한다. 더 많은 파기가 필요합니다.)
좋아요 내가 그렇게 노력할 것입니다. 그리고 잘하면 일부 답변을 찾을 것입니다. –