authorization

.Net core App unable to get user details from Microsoft Graph API?

一世执手 提交于 2020-02-05 06:17:26
问题 Net core Web API project. I registered app in azure AD for Web API app. I configured swagger and I registered one more app in Azure AD. I am trying to do authorization on my webapis based on groups. In appsettings.json I have all the values. Below is my startup looks like. public void ConfigureServices(IServiceCollection services) { services.AddSingleton<IHttpContextAccessor, HttpContextAccessor>(); services .AddAuthentication(o => { o.DefaultScheme = JwtBearerDefaults.AuthenticationScheme; }

How to test asp.net location folder authorization programmatically

安稳与你 提交于 2020-02-02 13:59:43
问题 I have an location element in my web.config like so: <location path="Admin"> <system.web> <authorization> <allow roles="Domain\Development"/> <deny users="*" /> </authorization> </system.web> </location> This works to only allow members of the development group access to this folder. I was wondering if there is a way to simply test if a user has access to this folder? One scenario is creating menu items. I'd simply like to hide or not render links to pages in this folder if the user does not

How to test asp.net location folder authorization programmatically

非 Y 不嫁゛ 提交于 2020-02-02 13:57:33
问题 I have an location element in my web.config like so: <location path="Admin"> <system.web> <authorization> <allow roles="Domain\Development"/> <deny users="*" /> </authorization> </system.web> </location> This works to only allow members of the development group access to this folder. I was wondering if there is a way to simply test if a user has access to this folder? One scenario is creating menu items. I'd simply like to hide or not render links to pages in this folder if the user does not

How to test asp.net location folder authorization programmatically

谁说胖子不能爱 提交于 2020-02-02 13:56:13
问题 I have an location element in my web.config like so: <location path="Admin"> <system.web> <authorization> <allow roles="Domain\Development"/> <deny users="*" /> </authorization> </system.web> </location> This works to only allow members of the development group access to this folder. I was wondering if there is a way to simply test if a user has access to this folder? One scenario is creating menu items. I'd simply like to hide or not render links to pages in this folder if the user does not

How to test asp.net location folder authorization programmatically

两盒软妹~` 提交于 2020-02-02 13:54:12
问题 I have an location element in my web.config like so: <location path="Admin"> <system.web> <authorization> <allow roles="Domain\Development"/> <deny users="*" /> </authorization> </system.web> </location> This works to only allow members of the development group access to this folder. I was wondering if there is a way to simply test if a user has access to this folder? One scenario is creating menu items. I'd simply like to hide or not render links to pages in this folder if the user does not

Programmatically add [AllowAnonymous] attribute to all my controller methods

删除回忆录丶 提交于 2020-01-25 08:47:06
问题 I have a WebAPI2 REST api with several controllers. I use role based authentication. I put [Authorize] attributes on all my controllers and some methods. However, in the DEV environment I want to disable authentication. I was hoping that I can put some code into the WebApiConfig such as: public static class WebApiConfig { public static void Register(HttpConfiguration config) { config.MapHttpAttributeRoutes(); config.EnableCors(new EnableCorsAttribute("*", "*", "*")); //=======================

How to do authorization based on groups in .net core app?

十年热恋 提交于 2020-01-25 06:49:35
问题 net core application. My requirement is to add group based authorization. I am user in Azure AD. I belong to the some group names starts with BR and AR. Users belong to the AR groups only should be able to access my APIs. Currently my client application is Swagger and I am hitting APIS only through swagger. For example, In startup I can have the below code. services.AddAuthorization(options => { options.AddPolicy("AR-BitBucket-User", policyBuilder => policyBuilder.RequireClaim("groups",

headers = {“Authorization”: “bearer ” + accessToken['access_token'], “User-Agent”: userAgent} KeyError: 'access_token'

不打扰是莪最后的温柔 提交于 2020-01-24 22:58:12
问题 I found this code in this SO's answer however when I run it I get this error: in redcom.py I have: import time import requests import requests.auth import praw username = 'myusername' userAgent = "reddit natural language processing " + username clientId = 'myclientid' clientSecret = "myclientsecret" password = "mypasswd" #app_uri = http://127.0.0.1:65010/authorize_callback def getPraw(): return praw.Reddit(user_agent=userAgent, client_id=clientId, client_secret=clientSecret) global

Spring security authorization without authentication

人盡茶涼 提交于 2020-01-24 17:10:49
问题 I have a Java JSF 2, Spring 3, Hibernate 4 Java EE Application which uses a third party library to authenticate the users. I imported the required CA certs into my JVM, added the third library to the project and configured in web.xml. The library reads the users details from smart card. This whole setup is working and users are taken to the home page by the third party library. Here are my requirements to secure the application. Check one more time if the user exist in the application

Mongo Query failed with error code 13 and error message 'not authorized'

故事扮演 提交于 2020-01-24 14:21:26
问题 Error occures when I am trying to make an query to mongo instance on mLab. I am requesting it from spring boot app. Connection to database is stable. Below log from console. Monitor thread successfully connected to server with description ServerDescription{address=ds131531.mlab.com:31531, type=REPLICA_SET_PRIMARY, state=CONNECTED, ok=true, version=ServerVersion{versionList=[3, 4, 15]}, minWireVersion=0, maxWireVersion=5, maxDocumentSize=16777216, logicalSessionTimeoutMinutes=null,