From fc07b5b80cafeb98871327b233f5496fb4be1b51 Mon Sep 17 00:00:00 2001 From: anhefti Date: Tue, 21 May 2019 11:28:13 +0200 Subject: [PATCH] changed Rest API call Open edX from JWT to Beater token --- .../servicelayer/lms/impl/OpenEdxLmsAPITemplate.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/lms/impl/OpenEdxLmsAPITemplate.java b/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/lms/impl/OpenEdxLmsAPITemplate.java index 3590d283..dfc0e347 100644 --- a/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/lms/impl/OpenEdxLmsAPITemplate.java +++ b/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/lms/impl/OpenEdxLmsAPITemplate.java @@ -318,7 +318,7 @@ final class OpenEdxLmsAPITemplate implements LmsAPITemplate { final MultiValueMap params = new LinkedMultiValueMap<>(); params.add("grant_type", "client_credentials"); - params.add("token_type", "jwt"); + //params.add("token_type", "jwt"); params.add("client_id", resource.getClientId()); params.add("client_secret", resource.getClientSecret()); @@ -340,7 +340,9 @@ final class OpenEdxLmsAPITemplate implements LmsAPITemplate { throw new AccessTokenRequiredException(resource); } - request.getHeaders().set("Authorization", String.format("%s %s", "JWT:", accessToken.getValue())); + request.getHeaders().set("Authorization", String.format("%s %s", "Bearer", accessToken.getValue())); + + //request.getHeaders().set("Authorization", String.format("%s %s", "JWT", accessToken.getValue())); } }