Reputation: 11
Basically I am new to SSO. I have two websites www.angularwebsite.com which talks to a .net core web API.Using azure ad , I can authenticate myself and I am able to log into www.angularwebsite.com using an Authorisation header "Bearer ". So far this is working. We have another website www.ecommercesite.com which is using SAML to authenticate Azure and it also works fine. Now how do I call this www.ecommercesite.com from my www.angularwebsite.com after authentication so that the tokens which I got by authenticating on www.angularwebsite.com is valid. Basically I don''t know how/where to call the www.ecommercesite.com (in angular by window.location.href) or in .NET API core My startup.cs in API CORE's classes are as follows:
public void Configure(IApplicationBuilder app, IHostingEnvironment env)
{
if (env.IsDevelopment())
{
app.UseDeveloperExceptionPage();
}
app.UseCors("CorsPolicy");
app.UseAuthentication();
app.UseSession();
app.UseMvc();
//How do redirect when I come from angular to www.ecommercesite.com
}
My snippet of ConfigureService is as follows:
services.AddAuthentication(JwtBearerDefaults.AuthenticationScheme)
.AddJwtBearer(JwtBearerDefaults.AuthenticationScheme, configureOptions: null);
services.AddAuthorization(options =>
{
options.DefaultPolicy =
new AuthorizationPolicyBuilder(JwtBearerDefaults.AuthenticationScheme)
.RequireAuthenticatedUser()
.Build();
});
All the references to where I looked point to SSO with SPA and .Net core aPI which I already got. I am not able to find **"what if I want to navigate to another website"**using the same token. Kindly direct me to right place, I can try it myself. I don't know how to do.Thank you Regards, Jaga
Upvotes: 0
Views: 885