Suppose after user authenticates with linkedin successfully,
it redirects to your page http://www.xyz.com/redirect.php.
Now you have code in redirect.php which takes oauth parameters from URL and calls for userid.
function getUserID (){
// code which takes oauth params and calls linked in api with access token
//and returns userId of user
return userID;
}
$userID = getUserID();
Now since your have $userID
, create a session with $userID
and redirect user to his/her home page. Check for session in home page, if session $userID
is set , let user open the page , if session is not available, dont show the page and tell them to login first.
Now to your question, how do you think in this approach user can enter userID
by his/her own ?