w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML Categories
Share a user list between two Plone sites
One of the ways to maintain common userbase is to setup LDAP server and use LDAPUSerFolder. The are some downsides in this solution (LDAP groups vs Plone user groups), but it will work in many cases. I am aware if there are any simple instructions, but google is your friend.

Categories : Misc

Sites not accepting wget user agent header
It seems that Yahoo server does some heuristic based on User-Agent. Accept: text/html did the trick for me. e.g. wget --header="Accept: text/html" --user-agent="Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:21.0) Gecko/20100101 Firefox/21.0" http://yahoo.com Note: if you don't declare Accept header then wget automatically adds Accept:*/* which means give me anything you have.

Categories : Http

Logging to internal sites using user name and password in Firefox
I think this will allow you to bypass the windows authentication: http://ole.michelsen.dk/blog/firefox-auto-login-with-windows-authentication-and-ad/ From the link: To enable this in Firefox with a simple configuration change. Go to the address bar, and enter the following: about:config You will be prompted with a warning, so just confirm that “I’ll be careful, I promise!”. Now go to the filter bar, and enter this string: network.automatic-ntlm-auth.trusted-uris Double-click this value and add the domain of your intranet website, ex. “michelsen.dk” Edit: If you are trying to log in as a different user than your logged in user, then you will probably need to use AutoIT. Some more discussion on this issue here: How to automate username/passwor

Categories : Authentication

Nginx sites-enabled, sites-available: Cannot create soft-link between config files in Ubuntu 12.04
You need to start by understanding that the target of a symlink is a pathname. And it can be absolute or relative to the directory which contains the symlink Assuming you have foo.conf in sites-available Try cd sites-enabled sudo ln -s ../sites-available/foo.conf . ls -l Now you will have a symlink in sites-enabled called foo.conf which has a target ../sites-available/foo.conf Just to be clear, the normal configuration for Apache is that the config files for potential sites live in sites-available and the symlinks for the enabled sites live in sites-enabled, pointing at targets in sites-available. That doesn't quite seem to be the case the way you describe your setup, but that is not your primary problem. If you want a symlink to ALWAYS point at the same file, regardless of the wher

Categories : Ubuntu

How to convert multiple web sites hosted on IIS to Azure web sites
Considering www.foo.com/bar, www.foo.com/baz and wildcard.foo.com/bla are 3 independent web applications that share a domain (foo.com): Create a Windows Azure Website for each web application. You don't necessarily need to assign custom domain names to them. Create another, separate website and assign to it the *.foo.com domain using an A record. Refer to Configuring a custom domain name for a Windows Azure web site for instructions. As documented, "With an A record, you map a domain (e.g., contoso.com or www.contoso.com) or a wildcard domain (e.g., *.contoso.com) to the single public IP address of a deployment within a Windows Azure web site. The main benefit of this approach over using CNAMEs is that you can map root domains (e.g., contoso.com) and wildcard domains (e.g., *.contoso.com

Categories : Azure

Getting the right User.Identity
check the web.config to ensure <authentication mode="Forms" /> if you didn't set this explicitly, then you probably selected the mvc intranet template when you first created the project. once the config file is updated you will also need to create the login/off actions and views. you may want to create another project using the internet template and pull out the authentication components. intranet template defaults to windows authentication while internet template defaults to form.

Categories : Asp Net Mvc

New sites are created but not showing in My Sites drop down
Not sure if you ever resolved this or not, however since this page was the first to come up with I googled the issue, I figured it could use an answer. For me, it was human error due to the fact that I was managing so many users. I ended up not assigning them to my overall admin account. Once you go into the site's users and make sure to add your admin username, the site should show up.

Categories : Misc

Add to User.Identity another property
You should examine ASP.NET Membership and Profile providers. Here is a link where it is explained in detail. User.Identity.Name will have whatever the user input on authentication (email or username, depending on your code).

Categories : C#

How do you unauthenticate User.Identity
Check this question in SO. It contains the answer to your question and a lot more useful information: What is the difference between Session.Abandon() and Session.Clear() in ASP.Net? Edit: and just to be more specific, Abandon is what you're looking for.

Categories : Asp Net

Passing user identity from MVC to Web Api
You should use something like Kerberos delegation. The user will be authenticated in the MVC application using Kerberos then the Kerberos token will be passed to the Web API call. We do that currently at work to pass credentials from an ASP.NET app to an Exchange Webserver. It works fine. If you want more info check this KB: http://support.microsoft.com/kb/810572

Categories : C#

Accessing Windows 8 User Identity
As far as I know, it is not possible to get the name. So you need to ask the user he opens the app first time . But I like the solution, to put a predefined name in (like "Player" or maybe better "Player{RandomNumber}") and let the user change this. But it's possible to get the Live Id (anonymous) to identify the user in the background and update his last entry for example. See Using Windows Live ID authentication in a Windows Phone 8 app

Categories : Azure

Accessing to User.Identity in Application_Start()
There is no user in Application_Start. Application_Start runs when setting up the application, before any requests come in. It sounds like you actually want to set HttpContext state in Application_BeginRequest. (not Application state, which is global and is shared among all requests)

Categories : C#

How to pass additional data to the callback when we pass Guid object as user state?
Create method overloading [Not Tested] void by_server_AddFriendCompleted(int user,int friend, Guid NGuid, object sender, AsyncCompletedEventArgs e) { //I want soemthing like e.Parameter ? , like we use AsyncState in sockets // ex : Myperopetyclass c = e.Parameter , this is what i want if (e.Error != null) //error }

Categories : C#

MVC3 @Context.User.Identity.Name empty value
User.Identity.Name is set in the AuthenticateRequest event which is far earlier than when your controller action is invoked. Calling FormsAuthentication.SetAuthCookie ONLY adds the authentication cookie to the response, it does not populate that value, which is why that is empty. What you would see is that User.Identity.Name would be filled out on the next request to the page. Normally on a page that is doing authentication like this, you would redirect from the action that you are sending the POST request to the page that requires authentication.

Categories : C#

Override User.Identity.Name in built-in MVC 4 authentication
If you are using FormsAuthentication you need to set a cookie with the name of the currently authenticated user before redirecting using the SetAuthCookie method: if (ModelState.IsValid && IsValidUser(model.UserName, model.Password)) { FormsAuthentication.SetAuthCookie("FooBar", false); return RedirectToAction("Index", "Home"); } Now on the target controller action (/Home/Index), User.Identity.Name will be FooBar. Usually this happens inside the method you commented and your user is not even authenticated if you do not emit a forms authentication cookie. As far as the code in your IsValid method is concerned, well, all I can say is that IDisposable resources should be wrapped in using statements to ensure proper release of resources.

Categories : C#

Use Session ID to verify user identity -- safe to do so?
I can't fully understand your design. Using a database suggests permanent storage, but binding the cart to a session means that users cannot register and keep their carts. If cart is just session data, it should get stored right into $_SESSION. If cart is permanent, the key should be the user_id. If you want a session cart that optionally gets saved into database when user registers, you can either use both approaches or go for database only. If you choose the latter, user_id would be optional and $_SESSION would contain cart_id. Additionally, transmitting the session ID in the URL (the default behaviour in earlier PHP versions) proved to be a wrong idea: it's too easy to give away your session data inadvertently (e.g. by just sending a link to a friend). To sum up: there's normally

Categories : PHP

Attach a user's identity to a SQL Server Connection
The general approach is to attach a username to all records written... Either via a FK audit/history table or as a column on the table. Your application is what talks to the database - your users don't have any "pass through" that I'm aware of. Another option is to grab the user's username when they use your application, and place a connectionString in the user's session/whatever that uses integrated credentials with the user's username passed in... Then have the user use their uniquely stored connectionString during their use of the application. That should work, but you'll have to handle the SQLExceptions for permissions etc. in the code... which I suppose you had to handle regardless.

Categories : C#

Weird HttpContext.User.Identity issue
Your code uses static fields: public class ComplexUserData { public static string complexAccountName; ... Such a static field is shared by all threads, so all users are working on the same data(!) This is very dangerous. static is probably the most dangerous keyword, because the code works but fails weirdly in a multi-threaded scenario and can leak information to other parties. Solution: Don't use static unless you really understand what it does. Never store per-user, per-request or similar information in static variables. Store all user information in the session, in a database or a similar data store.

Categories : Asp Net Mvc

How can I use User.Identity.Name to work in a class outside of a Controller?
According to the reflected code, the HttpContext.Current.User is set during the windows authentication OnAuthenticate event. // System.Web.Security.WindowsAuthenticationModule private void OnAuthenticate(WindowsAuthenticationEventArgs e) { if (this._eventHandler != null) { this._eventHandler(this, e); } if (e.Context.User == null) { if (e.User != null) { e.Context.User = e.User; return; } if (e.Identity == WindowsAuthenticationModule.AnonymousIdentity) { e.Context.SetPrincipalNoDemand(WindowsAuthenticationModule.AnonymousPrincipal, false); return; } e.Context.SetPrincipalNoDemand(new WindowsPrincipal(e.Identity), false); } } May need to check whether on

Categories : Asp Net Mvc

User.Identity.IsAuthenticated is false after successful login
Because when you call FormsAuthentication.SetAuthCookie(txtUsername.Value, true); you store the key on the client's cookies. For this you need to do a response to the user. And for HttpContext.Current.User.Identity to be filled with cookie you need one more request. In short your scheme looks like this: Client sends his UserName and Password. Server gets and checks it. If they are valid the server sends Set-Cookie header to the client. Client receives and stores it. For each request client sends cookies back to the server.

Categories : C#

add new user to external ldap in wso2 Identity Server
you can use SCIM. check the following blogs they can help pavithramadurangi.blogspot.com sureshatt.blogspot.com

Categories : Wso2

Changing user identity during an active SignalR connection — how to reconnect?
that is simple, do not rely on user identification , instead create your own cookie that you can track every user regardless of if this user was logged in or not . just like many AD agancies have cookies to track users even if they are not signed in .

Categories : Asp Net Mvc

Defining Model relations between Identity and User using omniauth and devise
The foreign_key parameter should be in the User Model. Try this in your User model : has_many :identities, class_name: "Identity", foreign_key: "uid" And this in your Identity model : belongs_to :user

Categories : Ruby On Rails

WebApi: User.Identity.IsAuthenticated true for first request, false thereafter
The answer is explained in some detail here. In short, setting the Thread.CurrentPrincipal is not enough. I have set the HttpContext.Current.User too now, and it is working. In the original post, the async method on the MediaTypeFormatter was being called, creating additional threads, resulting in the CurrentPrinciple being attached to some other thread, and not the one that your controller action ends up being executed on. As for why it has to be set in two places, the explanation can be found here. It says: If your application performs any custom authentication logic, you must set the principal on two places: Thread.CurrentPrincipal: This property is the standard way to set the thread's principal in .NET. HttpContext.Current.User: This property is specific to ASP.NET.

Categories : Dotnet

how to get next Identity not the last inserted identity of Identity column
You don't need to do anything to "lock" an IDENTITY value. As soon as the table uses a value of an IDENTITY, it's used forever, even if you do a rollback. SQL Fiddle example: http://sqlfiddle.com/#!3/5fdb9/1/0. Note the ids that make it into the table, only 1 and 5. If that doesn't address your problem, please revise your question.

Categories : Sql Server

MVC application authentication set to Windows. Httpcontext.current.user.identity.name empty string
OK! Here is the answer. After sifting through the HttpContext object, I found the windows ID of the current user nested in the LogonUserIdentity child object. HttpContext.Current.Request.LogonUserIdentity.Name Why the normal HttpContext.User object is not being set? I have no idea! Anyway, problem solved!

Categories : C#

Finding out the current Identity Provider in Windows Identity Foundation
You typically use the Issuer and OriginalIssuer properties in each claim that you get. If you use e-mail as the unique identifier: var u = this.User as IClaimsPrincipal; var c = (u.Identity as IClaimsIdentity) .Claims .First( c => c.ClaimType == ClaimTypes.Email ); var issuer = c.Issuer; var originalIssuer = c.OriginalIssuer;

Categories : C#

Where is Microsoft.AspNet.Identity.Owin.AuthenticationManager in Asp.Net Identity RTM version?
That class is gone, as it was basically just adding methods that generated a ClaimsIdentity and passed that into an Owin.Security.IAuthenticationManager. Instead the RTM templates have a SignIn method in the controller that looks something like this: private async Task SignInAsync(ApplicationUser user, bool isPersistent) { AuthenticationManager.SignOut(DefaultAuthenticationTypes.ExternalCookie); var identity = await UserManager.CreateIdentityAsync(user, DefaultAuthenticationTypes.ApplicationCookie); AuthenticationManager.SignIn(new AuthenticationProperties() { IsPersistent = isPersistent }, identity); }

Categories : Asp Net

How to Alter a table for Identity Specification is identity SQL Server
You cannot "convert" an existing column into an IDENTITY column - you will have to create a new column as INT IDENTITY: ALTER TABLE ProductInProduct ADD NewId INT IDENTITY (1, 1); Update: OK, so there is a way of converting an existing column to IDENTITY. If you absolutely need this - check out this response by Martin Smith with all the gory details.

Categories : SQL

How to disable identity from the existing column & after adding data , how to enable identity again on the same column in SQL Server 2008?
Use SET IDENTITY_INSERT (http://msdn.microsoft.com/en-us/library/ms188059.aspx). SET IDENTITY_INSERT TableName ON; -- Insert Data. SET IDENTITY_INSERT TableName OFF;

Categories : Sql Server

User form can't pass value to module
I think two options: 1) change DemoDialogueOK to accept variables: Public Sub DemoDialogOk(SelPack as integer) ' ival = SelectedPacking Worksheets("Packed bed (Random)").Range("C17") = SelPack End Sub Private Sub OKButton_Click() SelectedPacking = ComboBox1.ListIndex Call DemoDialogOk(SelectedPacking) ... End Sub Or option two: fully qualify the variable from the useform i.e: Public Sub DemoDialogOk() ival = ufYourForm.SelectedPacking ... End Sub Public variables in userforms don't appear to be as "public" as module level...

Categories : Excel

How to pass user credentials to web service?
You can try to genereate your service client proxy using the method mentioned here. Once you have an instance of your WCF client proxy, it will have a property ClientCreditials which you can populate as needed. Hope this helps.

Categories : C#

How to pass value from page to User Control?
Say for you store the login name in a LABEL somewhere on the main page. Like this: lblLogin.Text = "LoginName"; Now, on the user control you have another LABEL called lblWCLogin where you want to assign the login name from Parent page. Do something like this: Label lblTextFromParentPageLabel = this.Parent.FindControl("lblLogin"); lblWCLogin = lblTextFromParentPageLabel.Text; Another Approach (does not matter if you have a MasterPage or not) is to Use Sessions. Set session on you Page or MasterPage code behind. Like this: Session["LoginName"] = "Some User Name"; Retrive the session value on UserControl like this: string login_name = (string)(Session["LoginName"]); Label1.Text = login_name;

Categories : C#

How to pass user arguments to a JS script to be run?
$( '.slider' ).each( function() { var $height = prompt("Please enter the height:","Your Height"); var $width = prompt("Please enter the width:","Your Width"); $( this ).slider( { height: $height, width: $width } ); } ); Or if all .slide elements have unique height/width (this avoid multiple pop up on the user browser) var slideHeight=prompt("Please enter the height:","Your Height"); var slideWidth=prompt("Please enter the Width:","Your Width"); $( '.slider' ).each( function() { var $height = parseInt(slideHeight)>0?parseInt(slideHeight):100; var $width =parseInt(slideWidth)>0?parseInt(slideWidth):100; $( this ).slider( { height: $height, width: $width } ); } );

Categories : Javascript

How to pass variable from user interface into controller
It's unclear which version of JavaFX you're using and what exactly you're trying to do. JavaFX 2.2 makes it really simple to create custom controllers. You can pass parameters into them directly from FXML, or programatically. If you're using version 2.2 you might benefit from reading Creating a Custom Control with FXML. The answer you're looking for might be there, especially in the section regarding FXMLLoaders. This thread might be helpful too.

Categories : Java

Disqus - How to pass current logged in user?
Your remote_auth is a form of authentication, just like access_token, so you'll want to pass that in your request as remote_auth=<YOUR_PAYLOAD>. If you pass "user=" that ID would have to be the Disqus user ID, which isn't the same as your remote_auth ID. Your remote_auth is a form of authentication, just like the access_token. However, keep in mind that we don't return as many details for SSO users as authenticated Disqus users. This is because the details are managed by you, the SSO site owner. To answer your other questions: You can use the client-side API to get these details, but we recommend the server-side API + caching the results to avoid bumping into API limits. URL-encode the payload and this will work

Categories : Api

Pass user-defined table type from VBA to SQL
ADO has a very nice table type. "Presently, the stored procedure to retrieve the dataset works fine. " Detach the dataset. The user will then edit the data in Excel... Append the new data to the detached dataset. Delete the old data from the detached dataset ... and send it back to the database. Re-Attach the dataset. Update the data: myRecordSet.ActiveConnection=oConnection myRecordSet.UpdateBatch

Categories : SQL

Change prompt to user with each loop pass
Use a list of prompts: prompts = ('first', 'second', 'third', 'fourth', 'fifth') items = [] for prompt in prompts: item = input("Input your {} thing: ".format(prompt)) items.append(item)

Categories : Python

Run PHP code on user click and pass variables
You want an ajax post call: //Inside your function var someVar = <?php echo $variable ?>; var anotherVar = <?php echo $newVar ?>; $.post("somepage.php", {firstParam : someVar, secondParam : anotherVar}, function(data) { //this is your response data from serv console.log(data); }); You ccan access that data you sent then: $paramOne = $_POST['firstParam']; $paramTwo = $_POST['secondParam']; echo "some response"; And your data from above will be "some response". In a nutshell;

Categories : PHP

Trying to pass the user type in a condition laravel
Have you tried using type comparison (=== vs ==) or maybe just: dd(in_array($user, array("Admin", "Superuser")));? What you're doing is basically "$user is not empty, and neither is 'admin' or 'superuser'"

Categories : PHP



© Copyright 2017 w3hello.com Publishing Limited. All rights reserved.