Skip to content

Instantly share code, notes, and snippets.

@merken
Created September 24, 2018 19:37
Show Gist options
  • Save merken/53ceee16e49888d32c210777c8b02086 to your computer and use it in GitHub Desktop.
Save merken/53ceee16e49888d32c210777c8b02086 to your computer and use it in GitHub Desktop.
UsersController.1.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using auth.api.Extensions;
using auth.api.Security;
using auth.api.Security.AzureAd;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
namespace auth.api.Controllers
{
[Route("api/users")]
[ApiController]
public class UsersController : ControllerBase
{
// GET api/values
[HttpGet]
public ActionResult<IEnumerable<string>> Get()
{
return new string[] { "maarten", HttpContext.User.Identity.Name };
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment