Predix_Logo
  • Categories
    • Questions
    • Predix | Updates
      • Pricing
      • Product
    • How-To
  • Explore
    • Topics
    • Questions
    • Articles
    • Feedback or Feature Requests
  • Sign in
  • Home /
  • Questions /
avatar image
0
Question by jhorgan@lanner.com · Oct 11, 2017 at 01:39 PM · uaa

UAA + ASP.NET Core + OpenId Connect

Hi,

I'm working on an Asp .Net Core 2.0 application that I am deploying to Predix. I want to use UAA to authenticate users with my application.

Has anyone any samples of how this is achieved with Asp .Net Core?

Thanks, Jeremy

Comment
Add comment
10 |1200 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

2 Replies

  • Sort: 
avatar image
0

Answer by jhorgan@lanner.com · Oct 13, 2017 at 03:52 AM

Thanks Tom,

Haven't managed to find anything on the forum.

I'm using the following but getting the following error: System.InvalidOperationException: IDX10803: Unable to obtain configuration from: 'https://.predix-uaa.run.aws-usw02-pr.ice.predix.io/.well-known/openid-configuration'.

I privately checked with Andrzej (https://forum.predix.io/questions/23629/aspnet-core-openid-connect-ssl.html) who also mentioned that in the last few weeks, his configuration has stopped too.

Does Predix UAA work with Asp .Net Core 2.0?

Regards, Jeremy

 public void ConfigureServices(IServiceCollection services)
 {
     services.AddAuthentication(options =>
         {
             options.DefaultScheme = CookieAuthenticationDefaults.AuthenticationScheme;
             options.DefaultChallengeScheme = OpenIdConnectDefaults.AuthenticationScheme;
         })
         .AddCookie()
         .AddOpenIdConnect(options =>
         {
             options.Authority = "https://<uaa-guid>.predix-uaa.run.aws-usw02-pr.ice.predix.io";
             options.RequireHttpsMetadata = true;
             options.ClientId = "login_client_id";
             options.ClientSecret = "password";
             options.ResponseType = OpenIdConnectResponseType.IdToken;
             options.SaveTokens = true;
             options.SignInScheme = "Cookies";
         });
 
     services.AddMvc();
 }
 
 // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
 public void Configure(IApplicationBuilder app, IHostingEnvironment env)
 {
     if (env.IsDevelopment())
     {
         app.UseDeveloperExceptionPage();
         app.UseBrowserLink();
     }
     else
     {
         app.UseExceptionHandler("/Error");
     }
 
     // Ahead of Mvc middleware
     app.UseAuthentication();
 
     app.UseStaticFiles();
 
     app.UseMvc(routes =>
     {
         routes.MapRoute(
             name: "default",
             template: "{controller}/{action=Index}/{id?}");
     });
 }
 
Comment
Add comment · Show 1 · Share
10 |1200 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Tom Turner ♦♦ · Oct 15, 2017 at 12:39 PM 0
Share

About 3-4 weeks ago they started requiring that Redirect urls be listed in the Client Id entry. If you use the Predix Dashboard you need to ensure you an entry containing the redirect uri of where the browser gets redirected back to your app, after login.

That might explain why Andrzej's app stopped working.

It's not clear what grant-type you are using.

UAA is just REST apis. So if you get the URL, the Headers, the Body or QueryParameters and the UAA data set up correct, it'll work.

avatar image
0

Answer by Tom Turner · Oct 11, 2017 at 02:10 PM

No official examples. But search the Forum, I recall some postings in the past.

Comment
Add comment · Share
10 |1200 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Follow this Question

Answers Answers and Comments

123 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Predix-UAA service returning 500 response 4 Answers

Unable to set redirect URI for hello world application 6 Answers

Explanation about UAA service 1 Answer

Getting uaa token as a string in predix seed? 2 Answers

Shared UAA integrate with RESTful API 5 Answers

GE Monogram
  • Legal
  • Forum Terms
  • Contact Us
  • Copyright © 2017 General Electric Company. All rights reserved.


Enterprise
Social Q&A

  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Create an article
  • Submit your feedback or feature request
  • Categories
  • Questions
  • Predix | Updates
    • Pricing
    • Product
  • How-To
  • Explore
  • Topics
  • Questions
  • Articles
  • Feedback or Feature Requests