Created
September 25, 2018 20:34
-
-
Save merken/417e435978b76069763d5c94279f72d4 to your computer and use it in GitHub Desktop.
UsersController.3.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Threading.Tasks; | |
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] | |
[Authorize(AuthenticationSchemes = Constants.AzureAdScheme)] | |
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