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
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.
Try adding this plugin: ionic plugin add cordova-plugin-whitelist otherwise http requests are blocked - as of the latest Cordova version.
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.
Does anyone have any idea?
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:
opened 04:02PM - 18 Nov 14 UTC
closed 05:54PM - 14 Jan 15 UTC
question
My app does not have a consistent login page such as `http://example.com/login`.… Rather my app's URLs are dynamic and token based, for example: `http://example.com/XH12aT1771`. My login box consists of a modal overlaid on top of this dynamic-type page.
Is it possible for me to avoid redirecting a user to a static callback url upon authenticating, such as `http://example.com/success`? The problem with redirecting a user to a static callback url is it's a poor user experience as it takes the user away from the page they're on.
Are there any other solutions to avoid redirecting the user such as presenting a popup window?