Log in to site using satellizer.js

0

I need to make an application where the user can sign in through facebook and soundcloud, and I found that link to do this, and according to this page link it is possible to do this with soundcloud by oAuth2, but I can not handle it, very close to the solution, because when using this code:

index.html

<md-button class="md-raised md-primary md-hue-2 btn-soundcloud" ng-click="authenticate('soundcloud')"></md-button>

controller.js

   .controller('LoginCtrl', function($scope, $auth) {
       $scope.authenticate = function(provider) {
         $auth.authenticate(provider);
       };
  });

config.js

    $authProvider.oauth2({
      name: 'soundcloud',
      url: 'https://soundcloud.com/connect',
      clientId: 'CLIENT_ID',
      redirectUri: window.location.origin + '/',
      authorizationEndpoint: 'https://api.soundcloud.com/oauth2/token',
      popupOptions: { width: 580, height: 400 }
    });

It opens a new window and returns the following error:

  {"errors":[{"error_message":"404 - Not Found"}]}

Has anyone ever used satellizer to log in with Soundcloud? Or simply if you can recommend me another one that does the same thing ...

    
asked by anonymous 22.05.2016 / 07:19

1 answer

0

I was able to solve my problem, I just changed my config.js to this form:

    $authProvider.oauth2({
      name: 'soundcloud',
      url: '/auth/soundcloud',
      clientId: 'CLIENT_ID',
      responseType: 'code',
      redirectUri: window.location.origin + '/callback.html',
      authorizationEndpoint: 'https://soundcloud.com/connect',
      popupOptions: { width: 580, height: 400 }
    });

I think the URL you were using in authorizationEndpoint was wrong.

    
23.05.2016 / 16:36