Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // GET: api/values
- [HttpGet]
- public IActionResult Get()
- {
- var scopes = HttpContext.User.FindFirst("http://schemas.microsoft.com/identity/claims/scope")?.Value;
- if (!string.IsNullOrEmpty(Startup.ScopeRead) && scopes != null
- && scopes.Split(' ').Any(s => s.Equals(Startup.ScopeRead)))
- return Ok(new string[] { "value1", "value2" });
- else
- return Unauthorized();
- }
Add Comment
Please, Sign In to add comment