Authenticate MS-Sharepoint user using PHP - php

I was told in the 'case-of-monday' meeting that I am going to integrate MS-sharepoint authentication to a existing PHP site. The idea is a MS-sharepoint user can login via the PHP site which has permission to query a sub set of the Sharepoint resources (generic documents i.e. employee manual).
I need something to get started. Any idea what tool/library can get this done? or suggestions?
Thx in advance.
Des

Maybe you should think about writing a web service that uses the SharePoint API to query the items that you need, then provide that web service to authenticated users in PHP.

Related

Google Spreadsheet User login

Okay, So I have a client that wants their wordpress site to only require user to use their email to login. They instead want the site read through a google spreadsheet of all the users. Then if the users email is found in the spreadsheet it allows the user to login.
Before people start screaming, I know its extremely bad from a security stand point, we've told them this. They don't care.
So my question is, has anyone one done this or something similar in the past. How did you do it.
And how would say is the best way to go about doing this. So far I have thought of a few ways to do it.
Secretly embed the doc on a hidden web page then access it.
Some how just access it using APIs
Maybe using google forms as the email entry, and some how use that to search the google docs.
Any ideas or helps, is appreciated greatly. Thank you.
Logging in via an email address is easy, there are already plugins to do it. https://wordpress.org/plugins/wp-email-login/
There is also a plugin for external authentication. Don't know if it does it from a spreadsheet, though you may have a way to sync the spreadsheet to an external DB (via an API perhaps):
https://wordpress.org/plugins/external-db-auth-reloaded/
Would you need the logged in user to have any user-specific account info? Could you get by with allowing each logged in user to essentially be using the same single account in WordPress?
I could see a solution where you hook into wp_authenticate() https://codex.wordpress.org/Plugin_API/Action_Reference/wp_authenticate
And in your hook function call, run out to Google Spreadsheet via their API and see if that email address is found in the list. If so, log them into WP using a preset, single account that's meant to be used for all such users.
Here's some basic info for reading from a Google Sheet via their API:
https://developers.google.com/sheets/samples/reading

API for Google for Education last login data of users?

I have a super admin privilege for google for education apps. I want to check if a specific user have already logged in to his/her account. I can manually do this admin console but i need to retrieve it using the web application that i created. I am just wondering if there's an API for this.
You can pull lastLoginTime with the Directory API.
If you're looking to pull login data for all, you can also use the Reports API. I would personally, recommend the Directory API over this though if you're looking for current data as it's not abnormal for the reports data to be a week old.
Another, perhaps not completely secure approach, would be to use a standalone google appscript. Turn on the admin SDK both in the advanced Google service menu and in the API. Then you can make standard GET requests to the appscript. This way the admin authentication is handled by the appscript.
function doGet(e) {
var email = e.parameter.email;
var someinfo = user.someinfo
Logger.log(someinfo);
return ContentService.createTextOutput(name);
}

Sign in with fb or twitter

For a project I am working on, I think having the functionality to sign in with facebook/ twitter would be beneficial.
I have some design theory to iron out.
When the user first logs into the website using either twitter or facebook, I'll get their email and other relevant information and store it in the database where a normal signed up user would be stored.
When they return, they would log in with twitter/ fb again and it would locate the information in the database and not add it again.
If anyone tried to sign up with the email address provided by either of these services, an email would be sent to the email address to confirm it is them and then they could generate just a password to allow them to log in with information already stored.
I could they link other data on the website to the userid I have stored for them throughout the entire process.
So my query would be whether this is the correct way to go about this?
How have others used these types of login api's and then binded them to on site data?
I believe this to be a reasonable question but if I have placed it in the wrong section, please feel free to move it!
Thanks.
well, everything should be written here http://developers.facebook.com/ also try using php sdk for facebook api, for twitter here https://dev.twitter.com/
Create an app in both fb and twitter, take the access token and access token secret
You should download all the files necessary and then configure them as is written in manual, if you will have trouble connecting to them write me a message to my mail(jurijs.nesterovs#inbox.lv) i'll try to help
Have done that before myself for my site. It was Fb/Twitter/Google. I bet thats the best thing to do. Google's API is the easiest out of these 3. Twitter was hard for me since I dont use OOP and all the libraries out there was OOP.
And about your design, my site was made not to not allow the user to join with the same email again. If they have joined using Facebook with an email, when they try to join using twitter with the same email, I would tell the user that they are already registered using Facebook.

YQL + PHP : how to make a facebook login

I was reading some stuff about the YQL api that Yahoo! has provided, I am not sure, but it appears to be a collection of lots of third party api into one common language, right?
what I don't get is how to make the facebook login through it so I can get the user profile data...
My project is to add a facebook(and other social networks) form login, because the website won't have his own login, people will have to use a social network to link in. Then I thought the YQL would help me out with this task so I wouldn't have to develop lots of functions to each one of the networks.
Reading this http://developer.yahoo.com/yql/guide/yql-code-examples.html#sdk_yql, I understood how to make a Yahoo login so I can access some private data, but couldn't find how I could do it with facebook and others
So my question... Can YQL help me with this? Can you give me a simple example of a facebook session using it within PHP? Are there alternatives to aid me in this task?
thanks,
Jonathan
Yes , using YQL you will be able to do this task .. you can look at this demo http://demo.tutorialzine.com/2010/05/showing-facebook-twitter-rss-stats-jquery-yql/demo.html. Also if you are going to only use Facebook authentication , then there is no need for YQL you can do it using http://developers.facebook.com/docs/authentication/
I highly doubt that YQL has an API that gives a free hand with facebook login. You have to consider how a login works. You send POST data to a web server containing client-side password hashes and encryptions, as well as other kinds of identification. YQL has no way to "standardize" logins - it would have to make a new API for every popular web site.

Get Twitter User Details without Authentication

I have noticed some Twitter Applications manage to get a particular users Location, Name, Profile Image etc using just the twitter username?
Hows is this possible?
I ask because I have not come across any where in the Twitter docs on how you can do this. I can get a users details myself using oAuth when the user provides my app permission but thats it.
Would be grateful if this could be cleared. I hope its not the use of CURL as this is not a good idea in my eyes. If there is another way, is there a PHP implementation that I could use.
Thank you for any help.
Update
I did not know that existed! Is there a PHP wrapper or class someone has written to use that ? Sorry, I am complete noob and I relay on wrappers and simple function calls!
It's returned by the users/show call from the API.
For example:
http://twitter.com/users/show.xml?screen_name=dougw
The API wiki lists a PHP library FWIW.

Categories