diff --git a/src/config/settings.js b/src/config/settings.js index 0c40de20527c2c29eefdd740a54f1ecea3eeed2d..abea8f9feb52d36221e6a8710e2e72f277c763ec 100644 --- a/src/config/settings.js +++ b/src/config/settings.js @@ -344,6 +344,10 @@ export default { { profile: 'http://iiif.io/api/auth/1/kiosk', kiosk: true }, { profile: 'http://iiif.io/api/auth/1/clickthrough' }, { profile: 'http://iiif.io/api/auth/1/login' }, + { profile: 'http://iiif.io/api/auth/0/external', external: true }, + { profile: 'http://iiif.io/api/auth/0/kiosk', kiosk: true }, + { profile: 'http://iiif.io/api/auth/0/clickthrough' }, + { profile: 'http://iiif.io/api/auth/0/login' } ] } }; diff --git a/src/containers/IIIFAuthentication.js b/src/containers/IIIFAuthentication.js index ba2eb5aed5724352d2a4b77cfcabe21633325b31..819796c8c6c516d4ebbe801de0e8f95cf2b27e0b 100644 --- a/src/containers/IIIFAuthentication.js +++ b/src/containers/IIIFAuthentication.js @@ -23,9 +23,11 @@ const mapStateToProps = (state, { windowId }) => { const accessTokenService = service && ( Utils.getService(service, 'http://iiif.io/api/auth/1/token') + || Utils.getService(service, 'http://iiif.io/api/auth/0/token') ); const logoutService = service && ( Utils.getService(service, 'http://iiif.io/api/auth/1/logout') + || Utils.getService(service, 'http://iiif.io/api/auth/0/logout') ); const authStatuses = getAuth(state) || {}; diff --git a/src/state/sagas/auth.js b/src/state/sagas/auth.js index 5f99c8c85d58f31ae07af4cfaaadc2f53242664d..21135885e2005a631cee0725559b63aa305cb792 100644 --- a/src/state/sagas/auth.js +++ b/src/state/sagas/auth.js @@ -52,7 +52,8 @@ export function* refetchInfoResponses({ serviceId }) { const haveThisTokenService = infoResponse => { const services = Utils.getServices(infoResponse); return services.some(e => { - const infoTokenService = Utils.getService(e, 'http://iiif.io/api/auth/1/token'); + const infoTokenService = Utils.getService(e, 'http://iiif.io/api/auth/1/token') + || Utils.getService(e, 'http://iiif.io/api/auth/0/token'); return infoTokenService && infoTokenService.id === serviceId; }); }; @@ -89,7 +90,8 @@ export function* doAuthWorkflow({ infoJson, windowId }) { // start the auth yield put(addAuthenticationRequest(windowId, authService.id, authService.getProfile())); } else if (profileConfig.external) { - const tokenService = Utils.getService(authService, 'http://iiif.io/api/auth/1/token'); + const tokenService = Utils.getService(authService, 'http://iiif.io/api/auth/1/token') + || Utils.getService(authService, 'http://iiif.io/api/auth/0/token'); if (!tokenService) return; // resolve the auth @@ -105,7 +107,8 @@ export function* rerequestOnAccessTokenFailure({ infoJson, windowId, tokenServic // make sure we have an auth service to try const authService = Utils.getServices(infoJson).find(service => { - const tokenService = Utils.getService(service, 'http://iiif.io/api/auth/1/token'); + const tokenService = Utils.getService(service, 'http://iiif.io/api/auth/1/token') + || Utils.getService(service, 'http://iiif.io/api/auth/0/token'); return tokenService && tokenService.id === tokenServiceId; }); diff --git a/src/state/sagas/iiif.js b/src/state/sagas/iiif.js index 9f5334235def9d1bfe44da3f0b9bc9df6cf797c5..f0ce4c5371f91f62095e952251dd786e998afec3 100644 --- a/src/state/sagas/iiif.js +++ b/src/state/sagas/iiif.js @@ -126,7 +126,8 @@ function* getAccessTokenService(resource) { for (let i = 0; i < services.length; i += 1) { const authService = services[i]; - const accessTokenService = Utils.getService(authService, 'http://iiif.io/api/auth/1/token'); + const accessTokenService = Utils.getService(authService, 'http://iiif.io/api/auth/1/token') + || Utils.getService(authService, 'http://iiif.io/api/auth/0/token'); const token = accessTokenService && accessTokens[accessTokenService.id]; if (token && token.json) return token; }