I need to get the contact list from the LDAP Server running on Linux.Is it there any android code or intent to access the ldap contents directly or we should only use the web services to access the ldap?I tried searching on the internet but no proper solution was found in any website.
DanielWeisser already did that. The project is on GIT, you can modify source if you let the credentials.
https://github.com/weisserd/LDAP-Sync
He used the UnboundID LDAP Librairy to make this.
Good luck.
You should try the LDAP client application https://market.android.com/details?id=com.unboundid.android.ldap.client&feature=search_result. It provides the ability to do searches in an LDAP directory and access the results directly (e.g., dial phone numbers, send e-mail, map/navigate to addresses, etc.) as well as add them to your contacts.
Related
I am having trouble searching for any example regarding LDAP authentication in my android app. There are some github links available but I am not able to understand what are the things required for such task to be done. Plz help...
I want to know the steps required and any dependency or other things as I am new to all this. Hope android being open source helps.
There is a sample application available here you can give it a try.
The entities required for LDAP authentication are:
The host address of the LDAP server.
The port number of the LDAP server.
The Username to use to bind to the server.
The password to use to bind to the server.
I am creating an application to access a GMail account and some other EMail accounts that are not GMail. How can I access the inboxes of those email accounts my application?
I assume the following:
You want to use Java.
You are trying to retrieve a list of emails.
You need to do this for GMail and non-GMail accounts.
You didn't mention anything about persisting the mails on your device, so I assume you want a quick snapshot of the inbox.
You didn't mention whether you want to leave the emails in the inbox or delete them upon retrieval, so you need a choice concerning that option.
You have no knowledge how fetching EMails works technically.
So first you need to decide on how to access the mails. As you need to access GMail and non-GMail accounts, it seems that accessing the mails via POP3 would be a natural fit. "Usually" this access method will also delete the mails from the users inbox, but there is an option to download mails without deleting them. Authenticating via POP3 is handled in numerous ways, so I would go for a library that does this for you.
I am neither an Android Developer nor do I have much to do with Java outside of JSF, but the Java Mail API seems to be capable of doing POP3 retrieval. And there is an implementation for Android.
Apart from that, your GUI might be missing a possibility to specify a server, a port and an option to pick the relevant encryption. You can of course "guess" these parameters from the given domain of the users email address, but you will need this information to retrieve the emails.
And of course you could also use IMAP, which the Java Mail API also seems to be capable of.
I need to know if a user entered correct login information to Microsoft Active directory
I want the user to enter username and password on an xpage and it should only return if these values was entered correctly or not.
I know I can use ldap requests and send in credentials but have not seen any working solutions for this.
I need to use java as the code should be able to run on non windows servers
There are a number of approaches you can take:
The easiest would be to link the AD to Domino using DirectoryAssistance and let users login using their AD credentials in the first place.
If IIS is running on the AD server you could send an HTTP request using the Apache HTTPClient (and basic authentication) and see what's coming back
The best working Java libraries are listed in the Apache Directory project. There you would do an LDAP query (e.g. the user herself)
Let us know which one works for you
You can use JNDI to access the Active Directory. There are a lot of ressources on the web on how to do this, for example have a look at http://mhimu.wordpress.com/2009/03/18/active-directory-authentication-using-javajndi/
You have tagged the question as XPage, do you want to do the authentication from inside domino? In that case the domino server could do the authentication.
I've worked through the examples for performing OOB OAuth2 connections and it works fine from my laptop.
The challenge I'm having is that it fires up a browser, asking me to verify if I want to grant access for my app to the documents in question. From then on it stores my credential set in a local file and continues to work just fine.
The use case I have is that I have a number of departments in my company that want to leverage Google Docs spreadsheets for reporting. I then want to be able to run a program on a server (from a cron job) that can scrape this data and build an aggregated report for all departments.
I had intended on creating a "reporting user" that is granted read access to all of the documents in question, then run the report process using that identity.
I tried running it on my laptop, then copying the stored credentials to my server for it to use. But it seems those credentials are tied to the machine and so it forces a new verification flow via browser.
Any suggestions on how to work with the auth flow for Google Drive to allow me to do what I need?
TIA
Rather than needing to grant some user read-only access to all docs, I'd suggest using a service account which has been granted read-only access to all of your Google Apps domain user's docs:
https://developers.google.com/drive/delegation
use:
https://www.googleapis.com/auth/drive.readonly
as the OAuth scope that you grant the service account access to in the Control Panel. That way if the server is compromised you've limited access to read-only.
Create GoogleCredential with p12 file from API console (API Access > Create Another Client ID > Service Account etc):
GoogleCredential.Builder#setServiceAccountPrivateKeyFromP12File(File)
more info on Service Accounts
The other answers are better than this, but you can always get a set of credentials and save them in a file for reuse. Getting the credentials could be done with a web browser, but only once, and then your server could use them forever (as long as you request offline access and get a refresh token).
i want my company website to access from my android phone but that website can only be accessed by registered member
i have login page in that i have to enter registered email and passwrd than directly from the login page only i have to redirect to my company web url ???
Please give suggestion
Thanks in advance
Edited, to be more explicit :
How to secure and restrict access to a website ?
Restrict network access
Maybe the simpliest solution. A web site is not always available on the internet or for everybody. In fact if your website sit in some machine in your company office, make it available on the net require more effort than just let local computers access to it.
What does that mean ? You configure your firewall and your network to allow access of your server for only some IP address/port. To continue on this network only solution, you can create a VPN that include your mobile phone devices.
Include authentification and authorization management directly in the application
The first solution is a first pass. It allow you to forbidd access to most people out of your organisation. But maybe you want more, you want for exemple that only people from marketing do have access to the web site. Or maybe you want depending of the user (or user group), allow them to do differents things.
The best way to do that is to directly manage uses rights into your website. You authenticate users, and when a specific functionnality is requested your firt verify is user has credential.
If you already have an IT department, it is likely that a directory is available with all users, their password and their groups. You can base your check on the directory, avoiding the harsle to create/delete users in your application directly.
Using a proxy to secure or authenticate access
This solution is like a melt of the other ones. First you make sure sure using network restriction that your web site is only accessible using the proxy machine (so only one IP basically). Then you use a web server (like Apache HTTPD server) as a proxy, or a gateway to access the website.
Basically, when a user want to request your website, it doesn't directly ask the application that manage it, but the proxy. Because the application server is isolated in the network, it doesn't have to be secured.
The proxy allow you to fine tune the behaviour of your web site :
you can add encryption using SSL to
all data that transit from the client
to server, so no senssible data is
sent unprotected
you can compress all data that
transit to optimize the bandwidth
usage (really important for mobile
device and their not so good
internet connexion).
you can use HTTP authentification to
check user has the right to access
to the page. This can be just a
login/password check, or a client
certificate to fully secure the
connexion, allowing only device
with the certificate to be granted
access.
You can tune access per group to certain part of the site, but this is not as flexible as retrictions done directly by the web site application.
Didn't catch you very well. Do you mean that you want your company website can just be accessed by android phone for registered member? If so, I think you can check what browser type can be used in android phone, and in your website check it from http request, like "String browserType=(String)request.getHeader("User-Agent");" .