我正在尝试构建多个小型ASP.Net核心Mvc服务,这些服务连接到使用IdentityServer4构建的Identity服务器.
我已经在MVC服务上设置了OpenIdOption,看起来像这样
app.UseCookieAuthentication(new CookieAuthenticationOptions
{
AuthenticationScheme = "Cookies"
});
app.UseOpenIdConnectAuthentication(new OpenIdConnectOptions
{
AuthenticationScheme = "oidc",
SignInScheme = "Cookies",
Authority = "http://localhost:5000",
RequireHttpsMetadata = false,
ClientId = "mvc",
ClientSecret = "secret",
ResponseType = "code id_token",
Scope = { "api1", "offline_access" },
GetClaimsFromUserInfoEndpoint = true,
SaveTokens = true
});
Run Code Online (Sandbox Code Playgroud)
http://localhost:5000我的Identity服务器运行的端点在哪里.如果我的MVC服务器在,http://localhost:5002我看到当我[Authorize]向控制器设置属性时,它会重定向到我的身份服务器,如果检查失败,它会查找返回的登录页面http://localhost:5002/signin-oidc
现在我遇到的问题是我要登录页面由我Identity Server托管的托管,http://localhost:5000/signin-oidc以便所有MVC服务只是利用它来获取用户身份,但不幸的是我无法看到如何设置它RedirectUrl.
我知道图表在参考流程时的工作原理是不准确的,只是想简化我想要完成的事情:)
有可能做到这一点吗?
关心Kiran
是否可以从ASP.Net MVC4 Web API应用程序返回'*.htm'文件?
我试图使用AngularJs来管理客户端视图,当我在我的页面上包含以下表达时:
<div ng-controller="application.RootController">
<div ng-switch="subview" >
<div ng-switch-when="home" ng-include="'../Views/Angular/customer/overview.htm'"></div>
<div ng-switch-when="admin" ng-include="'../Views/Angular/Admin/home.htm'"></div>
</div>
</div>
Run Code Online (Sandbox Code Playgroud)
我看到这在浏览器上按预期工作,但ASP.Net返回404页面未找到.
此外,我无法实际浏览任何htm页面,因此在配置路由以返回htm页面方面,我需要在ASP.Net MVC中做一些特殊事情吗?
我是 docker 新手,所以这可能听起来有点基本问题。
我有一个 VS.Net core2 控制台应用程序,它能够接受一些命令行参数并提供不同的服务。所以在正常的命令提示符中我可以运行类似的东西
c:>dotnet myapplication.dll 5000 .\mydb1.db
c:>dotnet myapplication.dll 5001 .\mydb2.db
这会在端口5000&上创建此应用程序的 2 个实例5001。
我现在想为此应用程序创建一个 docker 容器,并希望运行该映像的多个实例,并能够将此参数作为命令行传递给docker run命令。但是我无法看到如何在docker-compose.yml或Dockerfile
文件
FROM microsoft/dotnet:2.1-aspnetcore-runtime AS base
WORKDIR /app
EXPOSE 80
# ignoring some of the code here
ENTRYPOINT ["dotnet", "myapplication.dll"]
Run Code Online (Sandbox Code Playgroud)
docker-Compose.yml
version: '3.4'
services:
my.app:
image: ${DOCKER_REGISTRY}my/app
ports:
- 5000:80
build:
context: .
dockerfile: dir/Dockerfile
Run Code Online (Sandbox Code Playgroud)
我试图避免为每个命令行参数组合创建多个图像。那么有可能实现我正在寻找的东西吗?
我想使用tableau显示来自HDInsight SPARK的数据.我正在关注这个视频,他们已经描述了如何连接两个系统并公开数据.
目前我的脚本本身非常简单,如下所示:
/* csvFile is an RDD of lists, each list representing a line in the CSV file */
val csvLines = sc.textFile("wasb://mycontainer@mysparkstorage.blob.core.windows.net/*/*/*/mydata__000000.csv")
// Define a schema
case class MyData(Timestamp: String, TimezoneOffset: String, SystemGuid: String, TagName: String, NumericValue: Double, StringValue: String)
// Map the values in the .csv file to the schema
val myData = csvLines.map(s => s.split(",")).filter(s => s(0) != "Timestamp").map(
s => MyData(s(0),
s(1),
s(2),
s(3),
s(4).toDouble,
s(5)
)
).toDF()
// Register as a temporary …Run Code Online (Sandbox Code Playgroud) 我正在尝试学习如何使用Azure function和SignalR创建无服务器设计。为此,我创建了以下类Azure function:
public static class NotifactionR
{
[FunctionName("negotiate")]
public static SignalRConnectionInfo Negotiate(
[HttpTrigger(AuthorizationLevel.Anonymous)]HttpRequest req,
[SignalRConnectionInfo(HubName = "my-hub")]
SignalRConnectionInfo connectionInfo)
{
// connectionInfo contains an access key token with a name identifier claim set to the authenticated user
return connectionInfo;
}
[FunctionName("NotifactionR")]
public static Task NotifactionR([EventGridTrigger]EventGridEvent eventGridEvent,
[SignalR(HubName = "my-hub")]IAsyncCollector<SignalRMessage> signalRMessages,
ILogger log)
{
log.LogInformation(eventGridEvent.Data.ToString());
return signalRMessages.AddAsync(
new SignalRMessage
{
// the message will only be sent to these user IDs
UserId = "userId1", …Run Code Online (Sandbox Code Playgroud) angularjs ×1
apache-spark ×1
asp.net-core ×1
asp.net-mvc ×1
azure ×1
docker ×1
dockerfile ×1
hdinsight ×1
scala ×1
signalr ×1
tableau-api ×1