In my appliaction I have used linkedIn API to login. If the user is already loggedIn in the linkedIn in same browser and pressing linkedin login button in my website , the user will automatically loggedin to my website. But i want to ask 'Allow Access' popup authentication window provided by linkedIn.
EDIT : using Samer Bechara answer
$(document).ajaxSend(function(event, jqxhr, settings) {
if ( settings.url == "https://www.linkedin.com/uas/oauth/authenticate" ) {
settings.url = "https://www.linkedin.com/uas/oauth/authorize"
}
});
<script type="text/javascript" src="http://platform.linkedin.com/in.js">
api_key: apikey goes here
onLoad: onLinkedInLoad
authorize: false
</script>
<script type="text/javascript">
function onLinkedInLoad() {
IN.ENV.js.scope = new Array();
IN.ENV.js.scope[0] = "r_emailaddress";
IN.ENV.js.scope[1] = "r_contactinfo";
//IN.User.authorize();
IN.Event.on(IN, "auth", onLinkedInAuth);
}
function onLinkedInAuth() {
IN.API.Profile("me").fields("id,firstName,lastName,headline,emailAddress,mainAddress,phoneNumbers").result(displayProfiles);
}
function displayProfiles(profiles) {
member = profiles.values[0];
var phs="";
var mid =member.id;
var eid= member.emailAddress;
var mad= member.mainAddress;
var ln= member.lastName;
var fn= member.firstName;
var json = JSON.stringify(profiles);
var ph=member.phoneNumbers._total;
if(ph >0){
phs=member.phoneNumbers.values[0].phoneNumber;
}
}
</script>