w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML Categories
Windows Azure Active Directory Single Sign On - Custom error page for log in errors
Totally possible. ACS gives you error messages in encodeed JSON like this {"context":null,"httpReturnCode":401,"identityProvider":"Google","timeStamp":"2010-12-17 21:01:36Z","traceId":"16bba464-03b9-48c6-a248-9d16747b1515","errors":[{"errorCode":"ACS30000","errorMessage":"There was an error processing an OpenID sign-in response."},{"errorCode":"ACS50019","errorMessage":"Sign-in was canceled by the user."}]} First you need to enable the "Error URL feature" in management portal, for your ACS namespace-> Edit Relying party-> Error URL. You need a helper classes to decode the JSON. steps here Configure anon access to them Error page. With this you are in full control of the page, you can show the error message the way want and brand the page to match the look and feel of your relying

Categories : Asp Net Mvc

How to setup replication on apache directory server
There was some bug in apacheds 2.0 - M15 Version regarding replication. That bug has been rectified already and the fix will be in M16. I built 2 separate instances from apacheds svn trunk and built the installers and ran 2 separate instances. Added following settings/config on the Provider/Master (Running on Port 10389) - dn: ads-serverId=ldapServer,ou=servers,ads-directoryServiceId=default,ou=config changetype: modify add: ads-replReqHandler ads-replReqHandler: org.apache.directory.server.ldap.replication.provider.SyncReplRequestHandler Added following config to the consumer/slave instance (Running on 11389) - dn: ads-replConsumerId=1,ou=replConsumers,ads-serverId=ldapServer,ou=servers,ads-directoryServiceId=default,ou=config changetype: add ads-replRefreshNPersist: TRUE

Categories : Apache

How to set gecos attribute in Active Directory using directory services(C#)
I finally found the way to access the attribute. Instead of using directly the DirectoryEntry to connect to the LDAP such as : DirectoryEntry DEBase = new DirectoryEntry("LDAP://" + DomaineName); I used DirectoryContext context = new DirectoryContext(DirectoryContextType.Domain, domaineName)); DirectoryEntry dERoot = System.DirectoryServices.ActiveDirectory.Domain.GetDomain(context).GetDirectoryEntry(); Then I have no problem accessing the gecos attribute

Categories : C#

What errors do I have in my php code to create a new directory and then save a file in that new directory
Compare, what you assign to $dirStructure and $file. You can notice lack of leading / in fopen parameter. Nevertheless, echo('folderName/'.$trimmedInputA.'/'.$trimmedInputA.$inputB.$inputC.$inputD.'.csv'); would certainly help you to debug.

Categories : PHP

MySQL Replication - Can I create a table on a slave without breaking replication?
If your replication is set in master ---> slave mode, there is no problem in writing to a slave table, even if the table is present in master. It wont affect the replication process. In your case, the only possible cause for a replication failure would be when you create a table in your master, which is already in the slave. So the answer for your question is your replication won't break if you do this. Here is a good refernce

Categories : Mysql

Ehcache RMI Replication Not Working.Need to know how to visualise replication?
There was no problem as such.I think my testing was a bit off the mark. I had the same jsp being accessed from two nodes(by 2 diff browser sessions) and was relying on my logs to see for cues regarding replication.I just changed my approach to see the content/data on the jsp and i see that the other node fetches the same data after a hit on the first node has been updated.So this is enough for my test. however,I'm still curious to know how to see any logs about replication events? I turned on a instance of ehcache-debugger too but i didn't see any thing coming up. If anyone here can tell me how to see the logs pertaining to replication events that would be great.For the record,I have set the log level at TRACE for the net.sf package.

Categories : Caching

prevent or catch active record errors
You can always use find_by_id, which will return nil instead of throwing error. Or where(:id => 123).first, which will return nil, if record doesn't exist NOTE: Rails 4 syntax for these finders is: Post.find_by({ :id => 123 })

Categories : Ruby On Rails

Return value from Active Directory
FindName returns a string but you never use it anywhere string result = FindName(account); you can then use the local variable result inside your bExport_Click method as you wish

Categories : C#

Searching Active Directory using Sid
You can bind to an object directly given its SID like this: var entry = new DirectoryEntry("LDAP://<SID=S-your-sid-here>"); Both SID and sAMAccountName are unique in the domain.

Categories : C#

php Active Directory lookup
I think this filter should work: (&(objectClass=user)(sAMAccountName=yourUserName) (memberof=CN=YourGroup,OU=Users,DC=YourDomain,DC=com)) Well I am sure this could be tuned to work for you. -jim

Categories : PHP

Accessing Active Directory using C
If you are looking for other option other than openldap on Windows. You can try winldap, for more info you can visit their msdn page, there are some examples too which can help you. http://msdn.microsoft.com/en-us/library/windows/desktop/aa367033(v=vs.85).aspx

Categories : C

C# Active Directory authentication
I am not sure I understand AngularJS angle. If I had a regular WCF service I would use WindowsIdentity from ServiceSecurityContext.Current. http://msdn.microsoft.com/en-us/library/system.servicemodel.servicesecuritycontext.aspx ServiceSecurityContext securityContext = ServiceSecurityContext.Current; if (securityContext == null) throw new Exception("Failed to retrieve Service Security Context"); WindowsIdentity identity = securityContext.WindowsIdentity; currentUser.name = identity.Name

Categories : C#

integration between active directory and EPM
The latest version of the /n software BizTalk Adapters includes an LDAP Adapter that can be used to access active directory http://www.nsoftware.com/products/biztalk/adapters/ldap.aspx

Categories : Dotnet

Errors creating a button to delete an active record
The reason this is happening is that when you use an instance variable like @worker somewhere that url_to (inside of link_to or button_to, among others) will process it will assume routes based on the classname. In this case your class is Worker. Since @worker is a Worker it is trying to use worker_path, but you don't actually have that route defined. For a simple resource, routes would look like this: new_worker GET /workers/new(.:format) workers#new edit_worker GET /workers/:id/edit(.:format) workers#edit worker GET /workers/:id(.:format) workers#show PUT /workers/:id(.:format) workers#update DELETE /workers/:id(.:format) workers#destroy So a DELETE on worker_path would be what you want. However since you have some m

Categories : Ruby On Rails

ASP.NET MembershipProvider - SQL Server vs. Active Directory
Your question is unanswerable, as "performance" depends greatly upon many factors.. for instance, network speed, network latency, network saturation, the power of your AD server vs your SQL Server, the disk subsystems in use in either, etc... There is no way to say one way or the other without thoroughly evaluating each environment, and even at that point, you should just benchmark each and determine what works best for you. In most cases, though.. the decision between sql vs ad has nothing to do with performance, and has to do with the features offered by each. I would strongly doubt you have 100,000 users in your active directory, as that would cost a millions of dollars in licensing costs.

Categories : Asp Net

Connect to Active Directory using credential
The LDAP path to the users container is not correct. The users container is not an organizational unit but a simple container. So, you have to specify a different LDAP path. The LDAP path to the users container in your case is: LDAP://cn=Users,dc=abc,dc=def,dc=com Also consider what Hall72215 mentioned in his answer. Use the whole LDAP path directly in the constructor of the DirectoryEntry class.

Categories : C#

Active Directory Groups not being returned
If it is ASP.NET this should work: public static List<string> GetGroups(string userName) { RoleProvider roleProvider = new WindowsTokenRoleProvider(); return roleProvider.GetRolesForUser(userName).ToList(); } Super simple

Categories : C#

Adding Active Directory to a web site
If you are comfortable with PHP, you should be able to achieve the above no problem! The beauty of PHP is that someone somewhere along the line had the same problem as you so chances are, there's an established solution already. adLdap seems to be a good solution, a library that already does most of the hard work for you and all you'd need to do would be integrate it into your script! See: http://adldap.sourceforge.net/wiki/doku.php?id=documentation_user_functions Hopefully this can make it a little easier for you so you can concentrate on the other things like the actual functionality of the website itself.

Categories : PHP

Scripting Log On To Attribute in Active Directory
if you install adsiedit it will help you get the appropriate LDAP string to use. it's easy to get tripped up with this stuff, so i'd verify that the object you're looking for really is located where you think it is. for instance, i open adsiedit.msc (by ctrl+r adsiedit.msc enter) right click, choose connect to. then under computer i choose default. then i hit ok. i can then dig around the folder structure of AD for the object (person) i'm looking for. in my AD Schema, my user account can be navigated to using LDAP://CN=greenierb,OU=TSG,OU=Users,OU=Accounts,OU=Boston,OU=Offices,DC=domain,DC=com which is the reverse of the folder structure you navigate through in adsiedit (from the bottom of the hierachy (ie the user) up).

Categories : Vbscript

Modifying Users in Active Directory
Something like this should work: Const ADS_PROPERTY_APPEND = 3 dn = "cn=YoungRob,ou=R&D,dc=NA,dc=fabrikam,dc=com" isMember = False 'check regular group memberships For Each m In objGroup.GetEx("member") If LCase(m) = LCase(dn) Then isMember = True Exit For End If Next 'check primary group primaryGroupID = GetObject(dn).Get("primaryGroupID") objGroup.GetInfoEx Array("primaryGroupToken"), 0 If primaryGroupID = objGroup.Get("primaryGroupToken") Then isMember = True If Not isMember Then objGroup.PutEx ADS_PROPERTY_APPEND, "member", Array(dn)

Categories : Vbscript

Azure Active Directory authorization
It looks like you're using the AD libraries for traditional on-premise AD. To program against Azure AD, use the Auzre Authentication Library (AAL). Note, last week AAL was renamed to Active Directory Authentication Library. http://msdn.microsoft.com/en-us/library/jj573266.aspx

Categories : C#

Insert users into Active Directory
Here's a general idea of the algorithm: Load user data from SQL Server Convert it into an LDIF (LDAP Data Interchange Format) file Import the LDIF file into Active Directory using the LDIFDE command-line tool Python, or any other programming language, can help you with step 2. Notice that the details of the conversion are very specific to how your data is represented. You'll have to carefully map each data base field into an LDAP attribute, and determine the classes to be used in the LDAP objects. Will the above modify existing users? yes, of course. You could write the LDIF in such a way that it updates the existing data, or if that's a problem you could verify first if an user exists in the Active Directory and don't add those changes to the LDIF file. Alternatively You could use

Categories : Python

Create Active Directory Group using C#
Try GroupPrincipal oGroupPrincipal = new GroupPrincipal(ctx, samAccountName); And oGroupPrincipal.Save(ctx); Code samples for Active Directory - http://www.codeproject.com/Articles/18102/Howto-Almost-Everything-In-Active-Directory-via-C# Active Directory With C#

Categories : C#

how to check the username in Active Directory in WPF
Your process has to be run under active directory user otherwise you should provide also active directory user credentials when creating PrincipalContext. This is simple code to find user by userName: var context = new PrincipalContext(ContextType.Domain, "yourDomainHost"); var userInfo = UserPrincipal.FindByIdentity(context, userName); EDIT: if you need to use directory searcher you can try this method: bool ContainsUser(string domain, string userName) { string ldapBase = string.Format("LDAP://{0}", domain); // in case if process is not running under AD user use: new DirectoryEntry(ldapBase, "userName", "password") using (var entry = new DirectoryEntry(ldapBase)) { using (var searcher = new DirectorySearcher(entry))

Categories : Wpf

ASP.NET: Disallow certain Active Directory users
I'd put the restricted department users into an AD Group, then you could put it in your web.config under authorizations denying that specific group privileges. See below for example (DepartmentIDs would be your AD group): <?xml version="1.0"?> <configuration> <system.web> <compilation debug="true" /> <authentication mode="Windows" /> <authorization> <allow roles="DomainNameAuthorizedUsers" /> <deny users="DomainNamesDepartmentIDs" /> </authorization> </system.web> </configuration> Users you can also specify as <deny users="comma-separated list of users"> Or you can deny roles. There are quite a few options here. You can also do permissions in IIS

Categories : Asp Net

authenticate against with Active Directory via samba
I recommend you this article http://technet.microsoft.com/en-us/magazine/2008.12.linux.aspx from Microsoft. The configure file seems OK.

Categories : Misc

Active Directory not working for offsite
A connection to AD will always require windows credentials. Your code, as posted, does not supply any credentials to AD. (You pass in a user name that you are looking up, but that is not the same as supplying credentials for the connection). This will work for users whose machines are attached to the domain...because your network credentials are passed in implicitly. For the external devs, when they VPN in, they supply credentials to the VPN protocol, which allows their machines to access your network, but that doesn't mean their machines are 'joined' to the domain...so AD will still require explicit credentials from them, including a personal password or a service account password that has permissions to access AD. This line: using (DirectoryEntry de = new DirectoryEntry("LDAP://server.

Categories : C#

Active Directory Development Environment
Consider ADFS and ws-federation. Ws-federation is an enterprise sso protocol that gives you cross domain authentication/authorization in a sso manner. Adfs is a free implementation of the protocol that sits on top of the active directory. It is relatively easy to set up. But having a client application that expects a ws-federation identity provider, you can substitute the provider with any compliant provider, your own or the identityserver which is another free implementation but can use a membership provider. The completely custom implementation on the other hand would give you a chance to set up and serve an arbitrary identities. The is a small learning curve for this approach but benetifs are: cross domain sso support for multiple browsers for free (kerberos/ntlm based ad authenti

Categories : Asp Net

Get computers list from certain OU in active directory?
From the online help page try using -SearchBase filter C:PS>Get-ADComputer -LDAPFilter "(name=*laptop*)" -SearchBase "CN=Computers,DC=Fabrikam,DC=com"

Categories : Powershell

MVC2 Active Directory Authentication
I think the solution is in the Authentication type. Originally, I was using the following: IIS Authentication Anonymous: Disabled ASP.NET Impersonation: Disabled Forms: Enabled Windows: Disabled And in my Web.config file I was using Forms authentication. Apparently for Active Directory authentication, the type has to be Windows. Original: <authentication mode="Forms"> <forms loginUrl="~/Account/LogOn" timeout="2880" /> </authentication> Revised: <authentication mode="Windows" /> <authorization> <deny users="?" /> </authorization> I know this worked, but since I'm new to MVC, I could still be missing something.

Categories : Asp Net Mvc

Account to query the active directory
You can explore an external active directory domain just providing a valid user of that domain to query the domain server to the DirectoryEntry object. string adUser = "DomainUser"; string adPass = "DomainUserPassword"; string path = "LDAP://x.x.x.x"; // Here goes your Domain Server IP. DirectoryEntry rootEntry = new DirectoryEntry(path, adUser, adPass); DirectorySearcher ds = new DirectorySearcher(rootEntry );

Categories : C#

login with active directory autentication in asp.net c#
Although you had supplied so little information about the domain and network relationship with your development machine and web server, I assume the web server has no physical connection to the Active Directory server that you depend your code on. Then it should be impossible for web server to query the AD directory. If web and AD servers are on same network than you may need to work on the firewall settings of both web server and AD server to make sure that they can communicate. If web and AD server have no communication problems you should check the availability of that "Validusers" to a code running at web server. As IIS applications run with the user account that is defined for the application pool that hosts the application, you should make sure that the app pool identity has enough

Categories : C#

Display thumbnailPhoto from Active Directory in PHP
This seems to be a JPEG-File. So you should be able to send that with the appropriate mime-type to the browser. So something like <img src="data:image/jpeg;base64,<?php base64encode($imageString); ?>"/> should be possible to output that image. But it might also be possible to put any image-format into that thumbnailPhoto-Attribute. Therefore I would put the content into a temporary file that will then be served directly from the server. To get the correct file-ending you will need to pass the file through finfo to get the correct mime-type. So you might do something like this: $tempFile = tempnam(sys_get_temp_dir(), 'image'); file_put_contents($tempFile, $imageString); $finfo = new finfo(FILEINFO_MIME_TYPE); $mime = explode(';', $finfo->file($tempFile)); echo '<img s

Categories : PHP

Active Directory Authentication failed asp.net
Authentication with active directory means windows authentication, so first of all, you need to set <authentication mode="Windows"> instead of <authentication mode="Forms">

Categories : Asp Net

DirectoryServicesCOMException (0x80072020) when using Active Directory from ASP.NET application
I believe the problem had multiple causes: Use of ASP.NET impersonation. Running the ASP.NET 3.5 application under an ASP.NET 4.0 application pool. To resolve the second one, upgrade the application to ASP.NET 4.0 or configure IIS to use ASP.NET 2.0.

Categories : Asp Net

Using Active Directory to login using a local user
This is all that the Websecurity.Login method does: public static bool Login(string userName, string password, bool persistCookie = false) { WebSecurity.VerifyProvider(); bool flag = Membership.ValidateUser(userName, password); if (flag) { FormsAuthentication.SetAuthCookie(userName, persistCookie); } return flag; } You can write your own method that authenticates against AD and then looks up the user name and the does sets the auth cookie something like: public static bool MyLogin(string userName, string password, bool persistCookie = false) { bool flag = CheckADUser(userName, password); if (flag) { string mappedUsername = GetMappedUser(userName); if(mappedUsername != "") { FormsAuthentication.SetAuthCooki

Categories : C#

NTLM Authentication with Active Directory using Java
In the following thread they put the Tomcat behind an Apache Server and use an Apache Module to perform the NTLM authentication. Spring 3 and NTLM authentication

Categories : Java

Regular expression for Active Directory Password
Regular expressions are a great tool, but don't solve everything. E.g., a regular expression can't count in the sense that you require. Yes, a regular expression can count e.g. consecutive letters, but it can't check that you e.g. have two of these and three of the others, spread over the complete input string. This also goes for your specific question. Specifically, checking these two different conditions in the same regular expression may become very difficult. In this case, I would advise not to use regular expressions and just write a small algorithm that performs all checks. Another advantage you get with this approach, is that mere mortals will be able to understand you algorithm when they revisit it later on. Always an added benefit.

Categories : C#

Comparing a hashed password with Active Directory
I don't know a way to do it with LDAP, but it can be done with Kerberos. A good starting point is Kerberos Authentication Technical Reference on technet. You may also want to check Logon and Authentication Technologies, which is the parent article and list a bunch of ways to authenticate against AD, with which I am not familiar.

Categories : Dotnet

Authentication against Active Directory using a Mobile Device
Take a look at the BUILD 2013 videos. Visual Studio 2013 will create a webproject that will automagically do all that for you (I think). Just bare in mind, it uses the Microsoft.OWin.Security beta packages. Also...you will need to install the AspNetWebTools2013 package first... http://www.asp.net/visual-studio/overview/2013/creating-web-projects-in-visual-studio#orgauthoptions

Categories : Vb.Net



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