mirror of
https://gitlab.com/openstapps/openstapps.git
synced 2026-01-18 15:42:54 +00:00
fix: add PKCE parameters for PAIA auth
This commit is contained in:
@@ -22,6 +22,7 @@ import {
|
||||
StringMap,
|
||||
AuthorizationError,
|
||||
AuthorizationErrorJson,
|
||||
BUILT_IN_PARAMETERS,
|
||||
} from '@openid/appauth';
|
||||
import {Browser} from 'ionic-appauth';
|
||||
import {PAIAAuthorizationNotifier} from './paia-authorization-notifier';
|
||||
@@ -41,8 +42,6 @@ const AUTHORIZATION_REQUEST_HANDLE_KEY =
|
||||
'appauth_current_authorization_request';
|
||||
export const AUTHORIZATION_RESPONSE_KEY = 'auth_response';
|
||||
|
||||
// TODO: PAIA specific ...!!! use whatever you can from the parent class !
|
||||
|
||||
export class PAIAAuthorizationRequestHandler {
|
||||
notifier: PAIAAuthorizationNotifier;
|
||||
|
||||
@@ -208,6 +207,18 @@ export class PAIAAuthorizationRequestHandler {
|
||||
scope: request.scope,
|
||||
};
|
||||
|
||||
// copy over extras
|
||||
if (request.extras) {
|
||||
for (const extra in request.extras) {
|
||||
if (
|
||||
request.extras.hasOwnProperty(extra) && // check before inserting to requestMap
|
||||
!BUILT_IN_PARAMETERS.includes(extra)
|
||||
) {
|
||||
requestMap[extra] = request.extras[extra];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const query = this.utils.stringify(requestMap);
|
||||
const baseUrl = configuration.authorizationEndpoint;
|
||||
|
||||
|
||||
@@ -65,7 +65,8 @@ export class PAIATokenRequestHandler {
|
||||
method: 'POST',
|
||||
data: {
|
||||
patron: request.patron,
|
||||
grant_type: 'client_credentials',
|
||||
grant_type: 'authorization_code',
|
||||
...request.toStringMap(),
|
||||
},
|
||||
headers: {
|
||||
'Authorization': `Basic ${request.code}`,
|
||||
|
||||
Reference in New Issue
Block a user