identity

How can keep the user logged in even after the browser has closed with Identity ASP.NET MVC framework?

回眸只為那壹抹淺笑 提交于 2019-12-11 07:05:58
问题 Currently, each time the user browser closes, he/she will have to login again. When they login, this is the code that I use to sign them in Identity. SignInManager.SignIn(user, false, false); Here is how my Authentication is configured today public void ConfigureAuth(IAppBuilder app) { app.CreatePerOwinContext(ApplicationDbContext.Create); app.CreatePerOwinContext<ApplicationUserManager>(ApplicationUserManager.Create); app.CreatePerOwinContext<ApplicationSignInManager>

Does Rust track unique object ids and can we print them?

心不动则不痛 提交于 2019-12-11 03:38:24
问题 Does Rust use some kind of instance id for each object behind the scenes and if so, can it be made visible? Consider this struct SomeStruct; fn main() { let some_thing = SomeStruct; println!("{:UniqueId}", some_thing); let another = some_thing; println!("{:UniqueId}", another); } I'm using a pseudo format string with {:UniqueId} here. In this case it may print 4711 4712 I know that Rust makes a bitwise copy and I want to make that actually visible. If I had such an instance id I could make it

Classic ASP getting SCOPE_IDENTITY() Value from SQL2005

独自空忆成欢 提交于 2019-12-11 03:26:16
问题 I can't figure out how to get the SCOPE_IDENTITY() back to my variables from an SQL2005 Store Procedure. My sSQL String: sSQL = "EXEC [sp_NewClaim] " & Chr(34) & ClaimNumber & Chr(34) & ", " & Request.Cookies("UserID") & ", " & Request.Cookies("MasterID") & ", " & Chr(34) & strRestaurante & Chr(34) & ", " & Chr(34) & Fecha & Chr(34) & ", " & Chr(34) & Hora & Chr(34) & ", " & Chr(34) & Request("Tiempo") & Chr(34) & ", " & Chr(34) & Request("Luz") & Chr(34) & ", " & Chr(34) & Request("Desc") &

I set IDENTITY_INSERT to ON but I get a SqlException saying it's OFF

时光怂恿深爱的人放手 提交于 2019-12-11 02:39:17
问题 I'm trying to grab thousands of invoices (and other stuff) from a text file and insert them into SQL Server 2008. I wrote a little console app to do this and it uses LINQ to SQL. After I insert all the existing invoices I want the Invoice_ID to be an identity column and auto-increment, so I have it designed as such: CREATE TABLE [dbo].[Invoice] ( [Invoice_ID] int IDENTITY(1,1) NOT NULL PRIMARY KEY, /* Other fields elided */ ) Before I start inserting invoices I call a stored procedure that

Is there a way to tell whether two COM interface references point at the same instance?

断了今生、忘了曾经 提交于 2019-12-11 00:48:04
问题 Given two interface references obtained from different sources. Is there a programmatic way to tell whether they're implemented by the same instance? A simple equality check of the interface references always fails. EDIT: Large parts of the original question, which turned out to be an independent problem have now been moved to a new question. 回答1: You could query for the IUnknown interface and compare these pointers. All other interface pointers are not guaranteed to return the same value

Admin Consent not working with App Model V2

怎甘沉沦 提交于 2019-12-10 23:26:46
问题 I have a web application that used Azure AD authentication and accesses graph.microsoft.com. We currently do the required application registration in Azure Management Portal, but we want to move to the new App Model V2 with application registration in apps.dev.microsoft.com. This allows us to use scopes that are defined in the application instead of resources defined in the Azure Portal. However, with exiting App Model, we can define admin-consent so that the admin can give consent to all

Entity Framework - SaveChanges() doesn't get the generated Identity key

橙三吉。 提交于 2019-12-10 18:45:42
问题 I'm using entities Framework in my project and it has been a nightmare! I have a SQL DB were I have a table called Form. Form has an ID that is a PK and Identity (it's automatically increased). This time I'm doing this: Dim form as int32 Dim dbform As New Entities1 Dim form696 As New Form dbform.AddToForm696(form) dbform.SaveChanges() ID = form.ID A week ago ID and form.ID had the key generated after insert, but now it only has 0. I don't know what happened for this to stop working. I had to

Asp.net Identity logout other user

喜欢而已 提交于 2019-12-10 18:15:27
问题 I'm usigin Asp.net Identity to authenticate user and I'm trying to lockout any user from admin side. But when I lockout any user who is online, It didn't logout. I have read many comments about my problem but all of them didn't work. I tried UserManager.UpdateSecurityStamp to logout user but it didn't work as well. How can I logout the user instantly when I lockout it ? public ActionResult LockUser(string userId) { _userManager.SetLockoutEnabled(userId, true); _userManager.SetLockoutEndDate

How to preserve object identity across different VMs

僤鯓⒐⒋嵵緔 提交于 2019-12-10 18:05:15
问题 To be specific let me illustrate the question with Spring http-remoting example. Suppose we have such implementation of a simple interface: public SearchServiceImpl implements SearchService { public SearchJdo processSearch(SearchJdo search) { search.name = "a funky name"; return search; } } SearchJdo is itself a simple POJO. Now when we call the method from a client through http-remoting (Spring's mechanism of calling remote objects much like EJB that uses serialization) we'll get: public

OnValidateIdentity session is null - Mvc Owin

大憨熊 提交于 2019-12-10 17:56:11
问题 Currently, I have problems when access Session in OnValidateIdentity - HttpContext.Current.Session is null. What's I wrong . My application as below: - I have 2 project : Mvc vs WebApi - I want user will logout when I changed password -> change security stamp. - I implement as: The Mvc Project will validate SecurityStamp changed when user request. And I'm will get SecurityStamp from other webapi website . This mean My mvc not access directly to database that through out webapi. And I'm must