Skip to content

Instantly share code, notes, and snippets.

@merken
Created September 24, 2018 19:37
Show Gist options
  • Save merken/58d440c9a1736571ffb14030af1caabb to your computer and use it in GitHub Desktop.
Save merken/58d440c9a1736571ffb14030af1caabb to your computer and use it in GitHub Desktop.
DataController.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.MyDb;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
namespace auth.api.Controllers
{
[Route("api/data")]
[ApiController]
public class DataController : ControllerBase
{
[HttpGet]
public ActionResult<IEnumerable<string>> Get()
{
return new string[] { "secret", "data", HttpContext.User.Identity.Name };
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment