Skip to content

Update to new config layout, AzureAd templates #862

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 13 commits into from
Jun 2, 2017

Conversation

HaoK
Copy link
Member

@HaoK HaoK commented May 26, 2017

Config updates addressing: aspnet/MetaPackages#117

@danroth27

New config's generated:

Individual:

{
  "Microsoft": {
    "AspNetCore": {
      "Hosting": {
        "Kestrel": {
          "Endpoints": {
            "Localhost": {
              "Address": "127.0.0.1",
              "Port": "5779"
            },
            "LocalhostHttps": {
              "Address": "127.0.0.1",
              "Port": "5777",
              "Certificate": "HTTPS"
            }
          }
        }
      },
      "IdentityService": {
        "Issuer": "https://localhost/F7B41B14-FE66-4D62-B9BF-4BBE7ABD2507/v2.0/",
        "SigningCertificates": "IdentityService"
      },
      "Authentication": {
        "Schemes": {
          "IdentityService": {
            "ClientId": "F4AB4DFE-292C-489E-8E4A-A3E43CEA3639",
            "TokenRedirectUrn": "urn:self:aspnet:identity:integrated"
          }
        }
      }
    }
  },
  "ConnectionStrings": {
    "DefaultConnection": "DataSource=.\\mvc_individual.db"
  },
  "Logging": {
    "IncludeScopes": false,
    "Debug": {
      "LogLevel": {
        "Default": "Warning"
      }
    },
    "Console": {
      "LogLevel": {
        "Default": "Warning"
      }
    }
  }
}

B2C:

{
  "Microsoft": {
    "AspNetCore": {
      "Hosting": {
        "Kestrel": {
          "Endpoints": {
            "Localhost": {
              "Address": "127.0.0.1",
              "Port": "5908"
            },
            "LocalhostHttps": {
              "Address": "127.0.0.1",
              "Port": "5906",
              "Certificate": "HTTPS"
            }
          }
        }
      },
      "Authentication": {
        "Schemes": {
          "AzureAdB2C": {
            "AzureAdB2CInstance": "https://login.microsoftonline.com/tfp",
            "ClientId": "90c0fe63-bcf2-44d5-8fb7-b8bbc0b29dc6",
            "CallbackPath": "/return-here",
            "Domain": "fabrikamb2c.onmicrosoft.com",
            "SignUpSignInPolicyId": "b2c_1_susi",
            "ResetPasswordPolicyId": "b2c_1_reset",
            "EditProfilePolicyId": "b2c_1_edit_profile"
          }
        }
      }
    }
  },
  "Logging": {
    "IncludeScopes": false,
    "Debug": {
      "LogLevel": {
        "Default": "Warning"
      }
    },
    "Console": {
      "LogLevel": {
        "Default": "Warning"
      }
    }
  }
}

Multi-Org:

{
  "Microsoft": {
    "AspNetCore": {
      "Hosting": {
        "Kestrel": {
          "Endpoints": {
            "Localhost": {
              "Address": "127.0.0.1",
              "Port": "5971"
            },
            "LocalhostHttps": {
              "Address": "127.0.0.1",
              "Port": "5969",
              "Certificate": "HTTPS"
            }
          }
        }
      },
      "Authentication": {
        "Schemes": {
          "AzureAd": {
            "AzureAdInstance": "https://login.microsoftonline.com/common",
            "ClientId": "1778fef7-9f7f-4bb3-87e1-0d4bbbe1f6e8",
            "CallbackPath": "/signin-oidc"
          }
        }
      }
    }
  },
  "Logging": {
    "IncludeScopes": false,
    "Debug": {
      "LogLevel": {
        "Default": "Warning"
      }
    },
    "Console": {
      "LogLevel": {
        "Default": "Warning"
      }
    }
  }
}

@mlorbetske
Copy link
Contributor

Is this ready to go?

@HaoK
Copy link
Member Author

HaoK commented May 27, 2017

Not yet, we still need to update all the consumers of the config

@mlorbetske
Copy link
Contributor

@HaoK any update?

@HaoK
Copy link
Member Author

HaoK commented Jun 1, 2017

Still waiting to finish the items under the convension based config checkboxes... hopefully soonish

aspnet/Announcements#243

@HaoK
Copy link
Member Author

HaoK commented Jun 1, 2017

Default schema for Kestrel endpoints (aspnet/KestrelHttpServer#1875)
Default schema for identity service settings (aspnet/Identity#1255)
Default schema for authentication settings (aspnet/Security#1245)

@HaoK HaoK force-pushed the haok/preview2 branch from bd67061 to d079b00 Compare June 1, 2017 18:25
@HaoK HaoK changed the title Update to new config layout Update to new config layout, AzureAd templates Jun 2, 2017
@HaoK
Copy link
Member Author

HaoK commented Jun 2, 2017

@danroth27 I've updated this PR and tweaked the AzureAD templates a bit, all the templates build/restore/run (except for IdentityService)

@@ -12,6 +12,51 @@
<Disp Icon="Str" Expand="true" Disp="true" LocTbl="false" Path=" \ ;Managed Resources \ 0 \ 0" />
<Item ItemId=";Strings" ItemType="0" PsrId="211" Leaf="false">
<Disp Icon="Str" LocTbl="false" />
<Item ItemId=";AddProjToSlnPostActionFailed" ItemType="0" PsrId="211" Leaf="true">
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are these changes in this PR?

var properties = new AuthenticationProperties() { RedirectUri = "/" };
properties.Items[AzureAdB2COptions.PolicyAuthenticationProperty] = Options.ResetPasswordPolicyId;
return Challenge(properties, OpenIdConnectDefaults.AuthenticationScheme);
return Challenge(AzureAdB2CDefaults.ResetPasswordAuthenticationScheme);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks much nicer!

{
public class AzureAdOptions
{
public string ClientId { get; set; }
public string ClientSecret { get; set; }
public string AzureAdInstance { get; set; }
public string Instance { get; set; }
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instance of what? How about BaseUri?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't have a strong opinion, we should use whatever the official term for this is, my main intent was to drop the name of of the options from the property

{
public static class AzureAdB2CDefaults
{
public const string AuthenticationScheme = "AzureAdB2C";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this one used anywhere?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nope, I'll remove

public string ClientId { get; set; }
public string AzureAdB2CInstance { get; set; }
public string Instance { get; set; }
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about BaseUri?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Or maybe InstanceUri?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this show up in any UI on the Azure side anywhere? What do they call it?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is just the base URI so that you could potentially point at a staging environment or some other variant.

// }
// "DefaultSignInScheme": "Cookies",
// "DefaultAuthenticateScheme": "Cookies",
// "DefaultChallengeScheme": "OpenIdConnect",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think the OpenIdConnect scheme is registered anymore given these changes. Should this be AzureAdB2CDefaults.SignUpSignInAuthenticationScheme?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yup good catch.

Copy link
Contributor

@mlorbetske mlorbetske left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The lcl changes need to be undone, looks good otherwise. I'd like to get an explicit ack that the IdentityService portion not working is expected at this point though (@danroth27)

@danroth27
Copy link
Member

@mlorbetske The identity service changes are being handled here: #870

@mlorbetske
Copy link
Contributor

Ah, didn't realize that was coordinated with this change. Thanks for the clarification!

@HaoK
Copy link
Member Author

HaoK commented Jun 2, 2017

Reverted and rebased, should be good to merge, we can address any other minor tweaks in subsequent PRs

@mlorbetske mlorbetske merged commit 3df378f into dotnet:rel/vs2017/3-Preview2 Jun 2, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants