Questions tagged [principal]

Use this tag for questions related to a principal programming principle.

For example:

In Python, a principal programming principle is the EAFP principle.

Read about principal in its general meaning in the Wiktionary.

159 questions
54
votes
3 answers

How should I check if a user is authenticated in MVC5?

I have seen the following two accessible booleans: System.Web.Mvc.Controller.User.Identity.IsAuthenticated System.Web.Mvc.Controller.Request.IsAuthenticated Is there a difference between these. They both seem to do the same thing so I am not sure…
user1679941
39
votes
2 answers

Keycloak retrieve custom attributes to KeycloakPrincipal

In my rest service i can obtain the principal information after authentication using KeycloakPrincipal kcPrincipal = (KeycloakPrincipal) servletRequest.getUserPrincipal(); statement. Keycloak principal does'nt cotain all the information i need…
Alex
  • 1,335
  • 1
  • 17
  • 39
16
votes
1 answer

Thread.CurrentPrincipal in .NET console application

Here is a trivial console application that i run in command prompt: using System; using System.Threading; namespace Test { internal class Runner { [STAThread] static void Main(string[] args) { …
UserControl
  • 13,469
  • 15
  • 88
  • 171
16
votes
2 answers

How do I implement custom Principal and Identity in ASP.NET MVC?

I want to store extra information in the authenticated user so that I can have it easily accessible (like User.Identity.Id, for example), instead of just the name, since I'm planning on having that non-unique. So far I've gathered that I should…
Kenji Kina
  • 2,352
  • 3
  • 20
  • 37
14
votes
2 answers

How do I start a thread in a different security context?

How to start a thread in the security context of a different user? When a process starts a thread normally the security context is also passed but how to launch a thread in a different security context with the principal of a different user?
TrustyCoder
  • 4,288
  • 8
  • 58
  • 108
12
votes
1 answer

Spring security accessing principal

When using spring security, specifically with @notation; what is the proper way to access the principal in a Controller? Lets say the following is my controller, but I would like to access the principal in the secure() method…
wuntee
  • 11,330
  • 26
  • 75
  • 105
11
votes
2 answers

Retaining principal inside queued background work item

I'm using ASP.Net Web API 2 / .Net 4.5.2. I'm trying to retain the calling principal when queueing a background work item. To that end, I'm trying to: Thread.CurrentPrincipal = callingPrincipal; But when I do so, I get an…
user47589
10
votes
2 answers

How to get logged user name/Principal in Spring MVC REST channel?

I have Spring MVC REST channel: @Controller @RequestMapping("/rest") public class REST { and I have my method: @RequestMapping(value = "/doSomething") public @ResponseBody DoSomethingResultDTO doSomething( @RequestBody…
Danubian Sailor
  • 21,505
  • 37
  • 137
  • 211
10
votes
2 answers

How I get Active Directory User Properties with System.DirectoryServices.AccountManagement Namespace?

I want do get Active Directory Properties from a user and I want to use System.DirectoryServices.AccountManagement. my code: public static void GetUserProperties(string dc,string user) { PrincipalContext ctx = new…
Tarasov
  • 3,282
  • 19
  • 59
  • 123
8
votes
1 answer

App Domain Level Impersonation

I am developing an application that needs to load plug-ins into separate child app domains. Only one plug-in is loaded into one child app domain. Each plug-in requires different Windows identity and those identities are different from the Windows…
Rest Wing
  • 2,650
  • 1
  • 21
  • 27
8
votes
1 answer

How do I get the Current User identity for a VPN user in a Windows forms app?

We're currently developing a Windows Smartclient that needs to authenticate users using their AD group membership. We now have a requirement for some users to connect over VPN. Is there any way I can get the AD account identity and groups from the…
Andronicus
7
votes
3 answers

Spring 3 MVC Controller integration test - inject Principal into method

As part of Spring 3 MVC it is possible to inject the currently logged in user (Principle) object into a controller method. E.g. @Controller public class MyController { @RequestMapping(value="/update", method = RequestMethod.POST) public…
7
votes
1 answer

What's the basic ideas of *continuous physic simulation* like box2d/bullet3d?

Traditional physics simulation in games or graphics industry was basically discrete. But engines nowadays such as box2d or bullet3d implement continuous physics simulation. I know basic principles of discrete simulation, but I have no idea about…
eonil
  • 75,400
  • 74
  • 294
  • 482
7
votes
1 answer

Set the Thread.CurrentPrincipal from IAuthorizationPolicy?

I have a WCF service running under .NET Framework 4.6.2. I have used the web.config before to configure the service with my custom IAuthorizationPolicy like this : behaviorConfiguration="MyClientService.CustomValidator_Behavior"…
Banshee
  • 15,434
  • 36
  • 111
  • 198
7
votes
1 answer

How to understand Principals in SQL Server?

This sounds stupid but I find it really confusing: in MSDN the definition is the entity that can request SQL Server resources. And basically there are three types of principals: Windows-level principals, SQL Server-level principals and…
tete
  • 4,389
  • 9
  • 44
  • 70
1
2 3
10 11