-
Notifications
You must be signed in to change notification settings - Fork 25.3k
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
Fixes #3862 Support SDK 1.0 in 2.0 topics #3870
Conversation
Minor clean up - remove future tense. Split up long sentences to help software translators.
@01binary, |
@scottaddie @tdykstra can you advice how to prevent PR from showing previous commits? |
@tdykstra @scottaddie Is this OK to merge? The file differences are correct and minimal. If it's OK, can one of you merge this? I'm traveling today. |
|
||
```csharp | ||
services.AddFacebookAuthentication(facebookOptions => | ||
services.AddFacebookAuthentication(new FacebookOptions() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The 2.0 RTM bits change the code to the following:
```csharp
services.AddAuthentication().AddFacebook(o => {
o.AppId = Configuration["Authentication:Facebook:AppId"];
o.AppSecret = Configuration["Authentication:Facebook:AppSecret"];
});
```
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reverting to prev. with named options object for readability
|
||
```csharp | ||
services.AddGoogleAuthentication(googleOptions => | ||
services.AddGoogleAuthentication(new GoogleOptions() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The 2.0 RTM bits change the code to the following:
services.AddAuthentication().AddGoogle(o => {
o.ClientId = Configuration["Authentication:Google:ClientId"];
o.ClientSecret = Configuration["Authentication:Google:ClientSecret"];
});
Add the Microsoft Account middleware in the `ConfigureServices` method in `Startup.cs` file: | ||
|
||
```csharp | ||
services.AddMicrosoftAuthentication(new MicrosoftAccountOptions() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The 2.0 RTM bits change the code to the following:
services.AddAuthentication().AddMicrosoftAccount(o => {
o.ClientId = Configuration["Authentication:Microsoft:ApplicationId"];
o.ClientSecret = Configuration["Authentication:Microsoft:Password"];
});
|
||
```csharp | ||
services.AddTwitterAuthentication(twitterOptions => | ||
services.AddTwitterAuthentication(new TwitterOptions() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The 2.0 RTM bits change the code to the following:
services.AddAuthentication().AddTwitter(o => {
o.ConsumerKey = Configuration["Authentication:Twitter:ConsumerKey"];
o.ConsumerSecret = Configuration["Authentication:Twitter:ConsumerSecret"];
});
|
||
Add the Facebook middleware in the `ConfigureServices` method in the *Startup.cs* file: | ||
* To install this package with Visual Studio 2017, right-click on the project and select **Manage NuGet Packages**. | ||
* To install with **dotnet** CLI, execute the following in your project directory: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
dotnet CLI --> .NET Core CLI
|
||
# [ASP.NET Core 1.x](#tab/aspnet1x) | ||
|
||
Add the Twitter middleware in the `Configure` method in `Startup.cs` file: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Italicize Startup.cs
|
||
# [ASP.NET Core 2.0](#tab/aspnet20) | ||
|
||
Add the Twitter middleware in the `ConfigureServices` method in `Startup.cs` file: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Italicize Startup.cs
> See the [MicrosoftOptions](https://github.com/aspnet/Security/blob/dev/src/Microsoft.AspNetCore.Authentication.Microsoft/MicrosoftOptions.cs) class in ASP.NET Core repository for more information on configuration options supported by Microsoft Account middleware. This can be used to request different information about the user. | ||
# [ASP.NET Core 2.0](#tab/aspnet20) | ||
|
||
Add the Microsoft Account middleware in the `ConfigureServices` method in `Startup.cs` file: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Italicize Startup.cs
|
||
# [ASP.NET Core 2.0](#tab/aspnet20) | ||
|
||
Add the Google middleware in the `ConfigureServices` method in `Startup.cs` file: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Italicize Startup.cs
@@ -84,25 +84,40 @@ The values for these tokens can be found in the JSON file downloaded in the prev | |||
|
|||
## Configure Google middleware | |||
|
|||
Note: The project template used in this tutorial ensures that | |||
[Microsoft.AspNetCore.Authentication.Google](https://www.nuget.org/packages/Microsoft.AspNetCore.Authentication.Google) package is installed. | |||
The project template used in this tutorial ensures that [Microsoft.AspNetCore.Authentication.Google](https://www.nuget.org/packages/Microsoft.AspNetCore.Authentication.Google) package is installed. | |||
|
|||
* To install this package with Visual Studio 2017, right-click on the project and select **Manage NuGet Packages**. | |||
* To install with **dotnet** CLI, execute the following in your project directory: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
dotnet CLI --> .NET Core CLI
@Rick-Anderson We may want to consider reverting the merge. The code snippets are incorrect for 2.0 RTM. |
I got confused with the signature, it is indeed a function returning XXXOptions. That's what I originally tested with before changing to new XXXOptions() [EDIT] Oops, didn't see on my phone that this got merged. We should roll back! Does anyone know how? I can do another PR if needed. |
Allright, cooking another PR, please don't merge it too soon this time. |
Added tabbed snippets like on this page:
https://docs.microsoft.com/en-us/aspnet/core/tutorials/first-web-api?tabs=aspnet1x
Unfortunately
docfx
cannot preview the tabs, you will have to look at internal build to verify they are working.Not sure why it says
17 commits
, merging just one. I pulled from this repo before making any changes. If you see anything wrong let me know.