Skip to content

National clouds readme #215

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 3 commits into from
Nov 28, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Http.Extensions;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.Options;
using System;
using System.Linq;
Expand All @@ -41,11 +42,13 @@ public class OnboardingController : Controller
{
private readonly SampleDbContext dbContext;
private readonly AzureADOptions azureADOptions;
private readonly IConfiguration configuration;

public OnboardingController(SampleDbContext dbContext, IOptions<AzureADOptions> azureADOptions)
public OnboardingController(SampleDbContext dbContext, IOptions<AzureADOptions> azureADOptions, IConfiguration configuration)
{
this.dbContext = dbContext;
this.azureADOptions = azureADOptions.Value;
this.configuration = configuration;
}

[HttpGet]
Expand Down Expand Up @@ -86,7 +89,7 @@ public IActionResult Onboard()
Uri.EscapeDataString(azureADOptions.ClientId), // The application Id as obtained from the Azure Portal
Uri.EscapeDataString(currentUri + "Onboarding/ProcessCode"), // Uri that the admin will be redirected to after the consent
Uri.EscapeDataString(stateMarker), // The state parameter is used to validate the response, preventing a man-in-the-middle attack, and it will also be used to identify this request in the ProcessCode action.
Uri.EscapeDataString("https://graph.microsoft.com/.default")); // The scopes to be presented to the admin to consent. Here we are using the static scope '/.default' (https://docs.microsoft.com/azure/active-directory/develop/v2-permissions-and-consent#the-default-scope).
Uri.EscapeDataString(configuration.GetValue<string>("GraphAPI:StaticScope"))); // The scopes to be presented to the admin to consent. Here we are using the static scope '/.default' (https://docs.microsoft.com/azure/active-directory/develop/v2-permissions-and-consent#the-default-scope).

return Redirect(authorizationRequest);
}
Expand Down
Loading