Skip to content

Commit

Permalink
Merge pull request dotnet#3872 from aspnet/master
Browse files Browse the repository at this point in the history
Update live with current master
  • Loading branch information
tdykstra authored Aug 2, 2017
2 parents 43bfff9 + 88069f5 commit 70e0407
Show file tree
Hide file tree
Showing 7 changed files with 111 additions and 63 deletions.
11 changes: 4 additions & 7 deletions aspnetcore/client-side/spa-services.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
---
title: Using JavaScriptServices for Creating Single Page Applications
author: scottaddie
description: Learn about the benefits of using JavaScriptServices to build a SPA with ASP.NET Core
keywords: ASP.NET Core, Angular, SPA, JavaScriptServices, SpaServices
description: Learn about the benefits of using JavaScriptServices to create a Single Page Application (SPA) backed by ASP.NET Core.
keywords: ASP.NET Core,Angular,SPA,JavaScriptServices,SpaServices
ms.author: scaddie
manager: wpickett
ms.date: 6/23/2017
ms.date: 08/02/2017
ms.topic: article
ms.assetid: 4b30576b-2718-4c39-9253-a59966747893
ms.technology: aspnet
Expand Down Expand Up @@ -95,13 +95,10 @@ The Tag Helpers are made discoverable via namespace registration in the project'

[!code-csharp[Main](../client-side/spa-services/sample/SpaServicesSampleApp/Views/_ViewImports.cshtml?highlight=3)]

These Tag Helpers abstract the intricacies of communicating directly with low-level APIs by leveraging an HTML-like syntax inside the Razor view:
These Tag Helpers abstract away the intricacies of communicating directly with low-level APIs by leveraging an HTML-like syntax inside the Razor view:

[!code-html[Main](../client-side/spa-services/sample/SpaServicesSampleApp/Views/Home/Index.cshtml?range=5)]

Microsoft's [Razor Language Services](https://marketplace.visualstudio.com/items?itemName=ms-madsk.RazorLanguageServices) extension improves Visual Studio 2017's Tag Helpers development experience by adding context-aware IntelliSense and syntax highlighting:
![Tag Helpers intellisense](../client-side/spa-services/_static/tag_helper_intellisense.png)

### The `asp-prerender-module` Tag Helper

The `asp-prerender-module` Tag Helper, used in the preceding code example, executes *ClientApp/dist/main-server.js* on the server via Node.js. For clarity's sake, *main-server.js* file is an artifact of the TypeScript-to-JavaScript transpilation task in the [Webpack](http://webpack.github.io/) build process. Webpack defines an entry point alias of `main-server`; and, traversal of the dependency graph for this alias begins at the *ClientApp/boot-server.ts* file:
Expand Down
Binary file not shown.
3 changes: 0 additions & 3 deletions aspnetcore/mvc/views/tag-helpers/intro.md
Original file line number Diff line number Diff line change
Expand Up @@ -123,9 +123,6 @@ The same hierarchy rules that apply to `@addTagHelper` also apply to `@tagHelper

## IntelliSense support for Tag Helpers

> [!NOTE]
> You must install the [Razor Language Service extension](https://aka.ms/razorlangsvc) for IntelliSense to work with Tag Helpers. See [ASP.NET Core Known Issues](https://github.com/aspnet/Tooling/blob/master/known-issues-vs2017.md#aspnet-core-known-issues) for more information.
When you create a new ASP.NET web app in Visual Studio, it adds the NuGet package "Microsoft.AspNetCore.Razor.Tools". This is the package that adds Tag Helper tooling.

Consider writing an HTML `<label>` element. As soon as you enter `<l` in the Visual Studio editor, IntelliSense displays matching elements:
Expand Down
42 changes: 28 additions & 14 deletions aspnetcore/security/authentication/social/facebook-logins.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ uid: security/authentication/facebook-logins

By [Valeriy Novytskyy](https://github.com/01binary) and [Rick Anderson](https://twitter.com/RickAndMSFT)

This tutorial shows you how to enable your users to sign in with their Facebook account using a sample ASP.NET Core 2.x project created on the [previous page](index.md). We start by creating a Facebook App ID by following the [official steps](https://developers.facebook.com/docs/apps/register).
This tutorial shows you how to enable your users to sign in with their Facebook account using a sample ASP.NET Core 2.0 project created on the [previous page](index.md). We start by creating a Facebook App ID by following the [official steps](https://developers.facebook.com/docs/apps/register).

## Create the app in Facebook

Expand Down Expand Up @@ -62,26 +62,40 @@ Link sensitive settings like Facebook `App ID` and `App Secret` to your applicat

## Configure Facebook middleware

> [!NOTE]
> The project template used in this tutorial ensures that
[Microsoft.AspNetCore.Authentication.Facebook](https://www.nuget.org/packages/Microsoft.AspNetCore.Authentication.Facebook) package is already 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:
>
> `dotnet add package Microsoft.AspNetCore.Authentication.Facebook`
The project template used in this tutorial ensures that [Microsoft.AspNetCore.Authentication.Facebook](https://www.nuget.org/packages/Microsoft.AspNetCore.Authentication.Facebook) package is already installed.

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:

`dotnet add package Microsoft.AspNetCore.Authentication.Facebook`

# [ASP.NET Core 1.x](#tab/aspnet1x)

Add the Facebook middleware in the `Configure` method in `Startup.cs` file:

```csharp
app.UseFacebookAuthentication(new FacebookOptions()
{
AppId = Configuration["Authentication:Facebook:AppId"],
AppSecret = Configuration["Authentication:Facebook:AppSecret"]
});
```

# [ASP.NET Core 2.0](#tab/aspnet20)

Add the Facebook middleware in the `ConfigureServices` method in the `Startup.cs` file:

```csharp
services.AddFacebookAuthentication(facebookOptions =>
services.AddFacebookAuthentication(new FacebookOptions()
{
facebookOptions.AppId = Configuration["Authentication:Facebook:AppId"];
facebookOptions.AppSecret = Configuration["Authentication:Facebook:AppSecret"];
AppId = Configuration["Authentication:Facebook:AppId"];
AppSecret = Configuration["Authentication:Facebook:AppSecret"];
});
```

Note: See the [FacebookOptions](https://github.com/aspnet/Security/blob/dev/src/Microsoft.AspNetCore.Authentication.Facebook/FacebookOptions.cs) class in ASP.NET Core repository for more information on configuration options supported by Facebook middleware. Configuration options can be used to:
---

See the [FacebookOptions](https://github.com/aspnet/Security/blob/dev/src/Microsoft.AspNetCore.Authentication.Facebook/FacebookOptions.cs) class in ASP.NET Core repository for more information on configuration options supported by Facebook middleware. Configuration options can be used to:

* Request different information about the user.
* Add query string arguments to customize the login experience.
Expand Down
31 changes: 23 additions & 8 deletions aspnetcore/security/authentication/social/google-logins.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ uid: security/authentication/google-logins

By [Valeriy Novytskyy](https://github.com/01binary) and [Rick Anderson](https://twitter.com/RickAndMSFT)

This tutorial shows you how to enable your users to sign in with their Google+ account using a sample ASP.NET Core 2.x project created on the [previous page](index.md). We start by following the [official steps](https://developers.google.com/identity/sign-in/web/devconsole-project) to create a new app in Google API Console.
This tutorial shows you how to enable your users to sign in with their Google+ account using a sample ASP.NET Core 2.0 project created on the [previous page](index.md). We start by following the [official steps](https://developers.google.com/identity/sign-in/web/devconsole-project) to create a new app in Google API Console.

## Create the app in Google API Console

Expand Down Expand Up @@ -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:

`dotnet add package Microsoft.AspNetCore.Authentication.Google`

Add the Google middleware in the `ConfigureServices` method in `Startup.cs`:
# [ASP.NET Core 1.x](#tab/aspnet1x)

Add the Google middleware in the `Configure` method in `Startup.cs` file:

```csharp
app.UseGoogleAuthentication(new GoogleOptions()
{
ClientId = Configuration["Authentication:Google:ClientId"],
ClientSecret = Configuration["Authentication:Google:ClientSecret"]
});
```

# [ASP.NET Core 2.0](#tab/aspnet20)

Add the Google middleware in the `ConfigureServices` method in `Startup.cs` file:

```csharp
services.AddGoogleAuthentication(googleOptions =>
services.AddGoogleAuthentication(new GoogleOptions()
{
googleOptions.ClientId = Configuration["Authentication:Google:ClientId"];
googleOptions.ClientSecret = Configuration["Authentication:Google:ClientSecret"];
ClientId = Configuration["Authentication:Google:ClientId"];
ClientSecret = Configuration["Authentication:Google:ClientSecret"];
});
```

Note: See the [GoogleOptions](https://github.com/aspnet/Security/blob/dev/src/Microsoft.AspNetCore.Authentication.Google/GoogleOptions.cs) class in ASP.NET Core repository for more information on configuration options supported by Google middleware. This can be used to request different information about the user.
---

See the [GoogleOptions](https://github.com/aspnet/Security/blob/dev/src/Microsoft.AspNetCore.Authentication.Google/GoogleOptions.cs) class in ASP.NET Core repository for more information on configuration options supported by Google middleware. This can be used to request different information about the user.

## Sign in with Google

Expand Down
44 changes: 28 additions & 16 deletions aspnetcore/security/authentication/social/microsoft-logins.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ uid: security/authentication/microsoft-logins

By [Valeriy Novytskyy](https://github.com/01binary) and [Rick Anderson](https://twitter.com/RickAndMSFT)

This tutorial shows you how to enable your users to sign in with their Microsoft account using a sample ASP.NET Core 2.x project created on the [previous page](index.md).
This tutorial shows you how to enable your users to sign in with their Microsoft account using a sample ASP.NET Core 2.0 project created on the [previous page](index.md).

## Create the app in Microsoft Developer Portal

Expand Down Expand Up @@ -66,29 +66,41 @@ Link sensitive settings like Microsoft `Application ID` and `Password` to your a

## Configure Microsoft Account middleware

> [!NOTE]
> The project template used in this tutorial ensures that
The project template used in this tutorial ensures that
[Microsoft.AspNetCore.Authentication.Microsoft](https://www.nuget.org/packages/Microsoft.AspNetCore.Authentication.Microsoft) package is already 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:
>
> `dotnet add package Microsoft.AspNetCore.Authentication.Microsoft`

Add the Microsoft Account middleware in the `ConfigureServices` method in `Startup.cs`:
* 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:

`dotnet add package Microsoft.AspNetCore.Authentication.Microsoft`

# [ASP.NET Core 1.x](#tab/aspnet1x)

Add the Microsoft Account middleware in the `Configure` method in `Startup.cs` file:

```csharp
services.AddMicrosoftAuthentication(microsoftOptions =>
app.UseMicrosoftAccountAuthentication(new MicrosoftAccountOptions()
{
microsoftOptions.ClientId = Configuration["Authentication:Microsoft:ApplicationId"];
microsoftOptions.ClientSecret = Configuration["Authentication:Microsoft:Password"];
ClientId = Configuration["Authentication:Microsoft:ApplicationId"],
ClientSecret = Configuration["Authentication:Microsoft:Password"]
});
```
> [!NOTE]
> Although the terminology used on Microsoft Developer Portal names these tokens `ApplicationId` and `Password`, they are exposed as `ClientId` and `ClientSecret` to the configuration API.

> [!NOTE]
> 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:

```csharp
services.AddMicrosoftAuthentication(new MicrosoftAccountOptions()
{
ClientId = Configuration["Authentication:Microsoft:ApplicationId"];
ClientSecret = Configuration["Authentication:Microsoft:Password"];
});
```

Although the terminology used on Microsoft Developer Portal names these tokens `ApplicationId` and `Password`, they are exposed as `ClientId` and `ClientSecret` to the configuration API.

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.

## Sign in with Microsoft Account

Expand Down
43 changes: 28 additions & 15 deletions aspnetcore/security/authentication/social/twitter-logins.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ uid: security/authentication/twitter-logins

By [Valeriy Novytskyy](https://github.com/01binary) and [Rick Anderson](https://twitter.com/RickAndMSFT)

This tutorial shows you how to enable your users to [sign in with their Twitter account](https://dev.twitter.com/web/sign-in/desktop-browser) using a sample ASP.NET Core 2.x project created on the [previous page](index.md).
This tutorial shows you how to enable your users to [sign in with their Twitter account](https://dev.twitter.com/web/sign-in/desktop-browser) using a sample ASP.NET Core 2.0 project created on the [previous page](index.md).

## Create the app in Twitter

Expand Down Expand Up @@ -48,27 +48,40 @@ These tokens can be found on the **Keys and Access Tokens** tab after creating y

## Configure Twitter middleware

> [!NOTE]
> The project template used in this tutorial ensures that
[Microsoft.AspNetCore.Authentication.Twitter](https://www.nuget.org/packages/Microsoft.AspNetCore.Authentication.Twitter) package is already 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:
>
> `dotnet add package Microsoft.AspNetCore.Authentication.Twitter`
The project template used in this tutorial ensures that [Microsoft.AspNetCore.Authentication.Twitter](https://www.nuget.org/packages/Microsoft.AspNetCore.Authentication.Twitter) package is already installed.

Add the Twitter middleware in the `ConfigureServices` method in `Startup.cs`:
* 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:

`dotnet add package Microsoft.AspNetCore.Authentication.Twitter`

# [ASP.NET Core 1.x](#tab/aspnet1x)

Add the Twitter middleware in the `Configure` method in `Startup.cs` file:

```csharp
app.UseTwitterAuthentication(new TwitterOptions()
{
ConsumerKey = Configuration["Authentication:Twitter:ConsumerKey"],
ConsumerSecret = Configuration["Authentication:Twitter:ConsumerSecret"]
});
```

# [ASP.NET Core 2.0](#tab/aspnet20)

Add the Twitter middleware in the `ConfigureServices` method in `Startup.cs` file:

```csharp
services.AddTwitterAuthentication(twitterOptions =>
services.AddTwitterAuthentication(new TwitterOptions()
{
twitterOptions.ConsumerKey = Configuration["Authentication:Twitter:ConsumerKey"];
twitterOptions.ConsumerSecret = Configuration["Authentication:Twitter:ConsumerSecret"];
ConsumerKey = Configuration["Authentication:Twitter:ConsumerKey"];
ConsumerSecret = Configuration["Authentication:Twitter:ConsumerSecret"];
});
```

> [!NOTE]
> See the [TwitterOptions](https://github.com/aspnet/Security/blob/dev/src/Microsoft.AspNetCore.Authentication.Twitter/TwitterOptions.cs) class in ASP.NET Core repository for more information on configuration options supported by Twitter middleware. This can be used to request different information about the user.
---

See the [TwitterOptions](https://github.com/aspnet/Security/blob/dev/src/Microsoft.AspNetCore.Authentication.Twitter/TwitterOptions.cs) class in ASP.NET Core repository for more information on configuration options supported by Twitter middleware. This can be used to request different information about the user.

## Sign in with Twitter

Expand Down

0 comments on commit 70e0407

Please sign in to comment.