authorization

Add Retrofit Requestinterceptor with Dagger at runtime

泄露秘密 提交于 2020-01-13 13:52:13
问题 I'm using dagger and retrofit. I inject my Retrofit services with Dagger. Now i wanna do a authorization request to get an accessToken. Afterwards i want to enhance my api module with an Request interceptor to use this access token for future requests. My idea is to use the ObjectGraph.plus() method after i received the access token, but i'm not sure if this is the best way to do it. Can someone point me to the right direction or maybe is there an example project on github ? 回答1: The key is

Kerberos Authorization w/ Node.js

六月ゝ 毕业季﹏ 提交于 2020-01-13 05:30:14
问题 I have found many different node.js authentication modules. Ei passport-kerberos. But I am looking to make background https calls to another kerberos authenticated site w/ an authorization token. Does anyone know of any modules for getting an authorization token from credentials in a node app? 来源: https://stackoverflow.com/questions/22724978/kerberos-authorization-w-node-js

Angular JS $locationChangeStart get next url route object

感情迁移 提交于 2020-01-12 07:18:26
问题 I am trying to implement Authorization on my angular application, when a route is changed I want to check whether the route is authorized for user or not. I tried with $routeChangeStart but it does not prevents the event. My current code: $scope.$on('$routeChangeStart', function(event, next, current) { if(current_user.is_logged_in){ var route_object = next.route_object; if(!(route_object.route_roles)){ event.preventDefault(); } } }); Here in my next object I am getting route_object which is

Angular JS $locationChangeStart get next url route object

怎甘沉沦 提交于 2020-01-12 07:18:10
问题 I am trying to implement Authorization on my angular application, when a route is changed I want to check whether the route is authorized for user or not. I tried with $routeChangeStart but it does not prevents the event. My current code: $scope.$on('$routeChangeStart', function(event, next, current) { if(current_user.is_logged_in){ var route_object = next.route_object; if(!(route_object.route_roles)){ event.preventDefault(); } } }); Here in my next object I am getting route_object which is

Using ajaxSetup beforeSend for Basic Auth is breaking SignalR connection

拜拜、爱过 提交于 2020-01-12 05:23:26
问题 I have a WebApi secured with Basic Auth which is applied to the entire Api using a AuthorizationFilterAttribute. I also have SignalR Hubs sitting on several of my Api Controllers. Alongside this I have a web page which makes use of my WebApi. The web page is mostly written in Backbone, so in order to make calls to my secured WebApi, I have added the following jquery $.ajaxSetup({ beforeSend: function (jqXHR, settings) { jqXHR.setRequestHeader('Authorization', 'Basic ' + Token); return true; }

How can I implement permission-based authorization in ASP.NET?

旧城冷巷雨未停 提交于 2020-01-11 19:55:06
问题 I'm working an a ASP.NET application (not using MVC) and need a User-Role-Permission based authorization scheeme, where pages and/or methods can demand the specific permission they require (instead of which role the user has). Is there a way to extend Forms Authentication (or building something) to solve this? If possible I would like to be able to use attributes: [RequirePermission("UserEdit")] public partial class EditUser : System.Web.UI.Page { } Perhaps even for methods: public class

How can I implement permission-based authorization in ASP.NET?

孤人 提交于 2020-01-11 19:53:19
问题 I'm working an a ASP.NET application (not using MVC) and need a User-Role-Permission based authorization scheeme, where pages and/or methods can demand the specific permission they require (instead of which role the user has). Is there a way to extend Forms Authentication (or building something) to solve this? If possible I would like to be able to use attributes: [RequirePermission("UserEdit")] public partial class EditUser : System.Web.UI.Page { } Perhaps even for methods: public class

.NET HttpWebRequest oAuth 401 Unauthorized

二次信任 提交于 2020-01-11 13:47:09
问题 I need to consume a web resource from a VB.NET app. I have successfully retrieved the access token and am ready to use it to make calls to the protected resource. However, everytime I call the protected resource I receive a 401 Unauthorized response because the Authorization field has not been added to the header. Here is my code. WebRequest = DirectCast(Net.WebRequest.Create(ApiUri), HttpWebRequest) WebRequest.Method = "POST" WebRequest.ContentType = "application/json" WebRequest

How to Optionally Protect a Resource with Custom Dropwizard Filter

旧巷老猫 提交于 2020-01-11 05:34:09
问题 I'm using Dropwizard 0.9.2 and I want to create a resource that requires no authentication for GET and requires basic authentication for POST. I have tried @Path("/protectedPing") @Produces(MediaType.TEXT_PLAIN) public class ProtectedPing { @GET public String everybody() { return "pingpong"; } @PermitAll @POST public String authenticated(){ return "secret pingpong"; } with CachingAuthenticator<BasicCredentials, User> ca = new CachingAuthenticator<>(environment.metrics(), ldapAuthenticator,

Should I use GoogleAuthUtil.getToken(…) or not?

情到浓时终转凉″ 提交于 2020-01-10 03:17:04
问题 Background: I need to authenticate on my server back-end so I know the client is genuine. In my Android game I connect to Games.API via GoogleApiClient . I only want to have to sign in once, which I want to do via Games.API , as this gives me many advantages (Google Play Games leaderboards, achievements, etc.) I have been able to get an authorisation token using GoogleAuthUtil.getToken(...) which I can do after I sign into Games.API , which seems to give me a token. Good so far. But Google