Nitin Nitin - 1 year ago 347
jQuery Question

Angularjs login twitter and linkedin custom without oath0 third party service

i have developed application in angular and i am done with facebook login custom without using Oath0 third party service.
i am done with login twitter with Oath service but not found any solution without Oath0 third party service.
So, is there any idea for the linkedin and twitter login in angular without using Oath0 third party service?

Answer Source

Here is example of twitter and linkedin login in your app module configuration make sure you have added ngsanitize

var app = angular.module("app", ['ngRoute', 'ngMessages','ngCookies','ngSanitize']);

in your controller file in login controller

app.controller("loginsController", function ($location, $scope, $http, $rootScope, constant,$q,twitterService) {
$scope.LinkedfoundMe = function (me) {
    $ = me;
$scope.connectTWButton = function() {
    twitterService.connectTwitter().then(function() {
        if (twitterService.isReady()) {
            //if the authorization is successful, hide the connect button and display the tweets

            $scope.connectedTwitter = true;
        } else {
 $scope.refreshTimeline = function() {
    twitterService.getTweetUser().then(function(data) {
        if(data[0] != null || data[0] != undefined){
            var TwData = {};
           TwData.firstName =data[0]; 
           TwData.lastName =""; 
           TwData.emailAddress =""; 
        $scope.rateLimitError = true;

now i have implemented linkedin login with jqery and pass data to angular function.below is code for linkedin login with js sdk. add javascript file to your html.

<script type="text/javascript" src="">
 api_key: YOUR_APP_KEY 
 onLoad: displayLinkedInLogin 
 authorize: false  

IN your controller file

function linkedAuthLink() {
IN.User.authorize(function () {
function displayLinkedInLogin() {
IN.Event.on(IN, "auth", onLinkedInAuth);
function onLinkedInAuth() {
        .fields(["firstName", "lastName", "emailAddress",       "pictureUrl", "id", "headline", "location", "summary", "positions", "twitter-accounts"])
function displayProfiles(profiles, $scope) {
member = profiles.values[0];

for linkedin you have to call controller from your html using ng-controller this is the only way to make it work. you need to download oauth.js file from below link oauth.js file for twitter auth

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download