Satellizer plugin and oAuth2 Envato API problem


#1

Hello,
I try to authenticate with new Envato API with Angular plugin Satellizer. In my localhost everything works fine, but I have problem in emulate mode and on my iPhone.

My settings:

$authProvider.oauth2({
        name: 'envato',
        url: '/#/login',
        authorizationEndpoint: 'https://api.envato.com/authorization',
        redirectUri: 'http://localhost/callback',
        clientId: 'MY-ID',
        platform: 'mobile',
        responseType: 'token'
    });

From authorization server I have got “code”, so this part works fine, but after I click on Authorize button popup doesn’t close and have error “Load Error”.

In logs i have message:

webView:didFailLoadWithError - -1004: Could not connect to the server.

Everyone can help me?

Regards,
Krzysiek


#2

#3

hmmm … its not my API.

I try emulate app in android and I had this page:

I have all params right, so API works fine. Its problem with redirect back to my app.


#4

Try adding this plugin: ionic plugin add cordova-plugin-whitelist otherwise http requests are blocked - as of the latest Cordova version.


#5

I installed this plugin, and to my config.xml file added:

<access origin="*"/>
<allow-intent href="http://*/*"/>
<allow-navigation href="*" />

… and its not work for me. I have same error.


#6

Does anyone have any idea? :confused:


#7

redirectUri: window.location.origin || window.location.protocol + ‘//’ + window.location.host,

And change the redirect configuration with your callback:
$authProvider.loginRedirect = ‘/’; // Change this relative path

You can check it too: