Permalink
Browse files

fix(BaseConfig): encode redirect url for all providers

LinkedIn denies access when redirect uri is not encoded

Fix#113
  • Loading branch information...
salman-ahmad committed Apr 23, 2016
1 parent e1e8fea commit adc90827fb8e12437d78d60611c11a66d05ccefb
Showing with 7 additions and 7 deletions.
  1. +7 −7 src/baseConfig.js
@@ -132,7 +132,7 @@ export class BaseConfig {
name: 'google',
url: '/auth/google',
authorizationEndpoint: 'https://accounts.google.com/o/oauth2/auth',
redirectUri: window.location.origin || window.location.protocol + '//' + window.location.host,
redirectUri: encodeURI(window.location.origin || window.location.protocol + '//' + window.location.host),
scope: ['profile', 'email'],
scopePrefix: 'openid',
scopeDelimiter: ' ',
@@ -149,7 +149,7 @@ export class BaseConfig {
name: 'facebook',
url: '/auth/facebook',
authorizationEndpoint: 'https://www.facebook.com/v2.3/dialog/oauth',
redirectUri: window.location.origin + '/' || window.location.protocol + '//' + window.location.host + '/',
redirectUri: encodeURI(window.location.origin + '/' || window.location.protocol + '//' + window.location.host + '/'),
scope: ['email'],
scopeDelimiter: ',',
nonce: function() {
@@ -167,7 +167,7 @@ export class BaseConfig {
name: 'linkedin',
url: '/auth/linkedin',
authorizationEndpoint: 'https://www.linkedin.com/uas/oauth2/authorization',
redirectUri: window.location.origin || window.location.protocol + '//' + window.location.host,
redirectUri: encodeURI(window.location.origin || window.location.protocol + '//' + window.location.host),
requiredUrlParams: ['state'],
scope: ['r_emailaddress'],
scopeDelimiter: ' ',
@@ -182,7 +182,7 @@ export class BaseConfig {
name: 'github',
url: '/auth/github',
authorizationEndpoint: 'https://github.com/login/oauth/authorize',
redirectUri: window.location.origin || window.location.protocol + '//' + window.location.host,
redirectUri: encodeURI(window.location.origin || window.location.protocol + '//' + window.location.host),
optionalUrlParams: ['scope'],
scope: ['user:email'],
scopeDelimiter: ' ',
@@ -196,7 +196,7 @@ export class BaseConfig {
name: 'yahoo',
url: '/auth/yahoo',
authorizationEndpoint: 'https://api.login.yahoo.com/oauth2/request_auth',
redirectUri: window.location.origin || window.location.protocol + '//' + window.location.host,
redirectUri: encodeURI(window.location.origin || window.location.protocol + '//' + window.location.host),
scope: [],
scopeDelimiter: ',',
type: '2.0',
@@ -219,7 +219,7 @@ export class BaseConfig {
name: 'live',
url: '/auth/live',
authorizationEndpoint: 'https://login.live.com/oauth20_authorize.srf',
redirectUri: window.location.origin || window.location.protocol + '//' + window.location.host,
redirectUri: encodeURI(window.location.origin || window.location.protocol + '//' + window.location.host),
scope: ['wl.emails'],
scopeDelimiter: ' ',
requiredUrlParams: ['display', 'scope'],
@@ -234,7 +234,7 @@ export class BaseConfig {
name: 'instagram',
url: '/auth/instagram',
authorizationEndpoint: 'https://api.instagram.com/oauth/authorize',
redirectUri: window.location.origin || window.location.protocol + '//' + window.location.host,
redirectUri: encodeURI(window.location.origin || window.location.protocol + '//' + window.location.host),
requiredUrlParams: ['scope'],
scope: ['basic'],
scopeDelimiter: '+',

0 comments on commit adc9082

Please sign in to comment.