Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix issue url query #190

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 17 additions & 2 deletions built/authorization_service_configuration.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 7 additions & 7 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 5 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
{
"name": "@openid/appauth",
"version": "1.3.1",
"version": "1.3.2",
"description": "A general purpose OAuth client.",
"author": "The OpenID Foundation",
"license": "Apache-2.0",
"repository": "openid/AppAuth-JS",
"repository": {
coicoronado marked this conversation as resolved.
Show resolved Hide resolved
"type": "git",
"url": "https://github.com/coicoronado/ionic-appauth.git"
},
"bugs": {
"url": "https://github.com/openid/AppAuth-JS/issues"
},
Expand Down
17 changes: 16 additions & 1 deletion src/authorization_service_configuration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,22 @@ export class AuthorizationServiceConfiguration {

static fetchFromIssuer(openIdIssuerUrl: string, requestor?: Requestor):
Promise<AuthorizationServiceConfiguration> {
const fullUrl = `${openIdIssuerUrl}/${WELL_KNOWN_PATH}/${OPENID_CONFIGURATION}`;
const searchForQueryParams = function(url: string) {
coicoronado marked this conversation as resolved.
Show resolved Hide resolved
let result;
let originalUrl: any = url.split('/');
let queryParams = originalUrl[originalUrl.length - 1].split('?');
if (queryParams.length > 1) {
originalUrl.splice(originalUrl.length - 1, 1);
originalUrl = originalUrl.join('/');
result = [originalUrl, `?${queryParams[queryParams.lenght - 1]}`];
} else {
result = [url, ''];
}

return result;
};
const newUrl = searchForQueryParams(openIdIssuerUrl);
const fullUrl = `${newUrl[0]}/${WELL_KNOWN_PATH}/${OPENID_CONFIGURATION}${newUrl[1]}`;

const requestorToUse = requestor || new JQueryRequestor();

Expand Down