summaryrefslogtreecommitdiff
path: root/eaaf_core
diff options
context:
space:
mode:
Diffstat (limited to 'eaaf_core')
-rw-r--r--eaaf_core/src/main/java/at/gv/egiz/eaaf/core/impl/idp/auth/RequestStorage.java35
1 files changed, 18 insertions, 17 deletions
diff --git a/eaaf_core/src/main/java/at/gv/egiz/eaaf/core/impl/idp/auth/RequestStorage.java b/eaaf_core/src/main/java/at/gv/egiz/eaaf/core/impl/idp/auth/RequestStorage.java
index 2b0cbab3..9758e258 100644
--- a/eaaf_core/src/main/java/at/gv/egiz/eaaf/core/impl/idp/auth/RequestStorage.java
+++ b/eaaf_core/src/main/java/at/gv/egiz/eaaf/core/impl/idp/auth/RequestStorage.java
@@ -160,14 +160,25 @@ public class RequestStorage implements IRequestStorage{
*/
@Override
public String changePendingRequestID(IRequest pendingRequest) throws EAAFException {
-
- //TODO!!!!
-
if (pendingRequest instanceof RequestImpl) {
- //final String newRequestID = Random.nextHexRandom32();
+
+ //get old internal pendingReqId
+ String oldInternalRequestID = null;
+ try {
+ oldInternalRequestID =
+ pendingReqIdGenerationStrategy.getPendingRequestIdWithOutChecks(pendingRequest.getPendingRequestId());
+
+ } catch (final PendingReqIdValidationException e) {
+ //it's no problem, because it must be valid before when pending-request was loaded and we change it now
+ oldInternalRequestID = e.getInvalidInternalPendingReqId();
+
+ }
+
+
+ //generate new pendingReqId and get internalPendingReqId
final String newRequestID = pendingReqIdGenerationStrategy.generateExternalPendingRequestId();
((RequestImpl)pendingRequest).setPendingRequestId(newRequestID);
-
+
String newInternalPendingRequestId = null;
try {
newInternalPendingRequestId = pendingReqIdGenerationStrategy.getPendingRequestIdWithOutChecks(newRequestID);
@@ -177,20 +188,10 @@ public class RequestStorage implements IRequestStorage{
}
- String oldInternalRequestID = null;
- try {
- oldInternalRequestID =
- pendingReqIdGenerationStrategy.validateAndGetPendingRequestId(pendingRequest.getPendingRequestId());
-
- } catch (final PendingReqIdValidationException e) {
- //it's no problem, because it must be valid before when pending-request was loaded and we change it now
- oldInternalRequestID = e.getInvalidInternalPendingReqId();
-
- }
+ //change Key in cache
log.debug("Change pendingRequestID from " + pendingRequest.getPendingRequestId()
- + " to " + newRequestID);
-
+ + " to " + newRequestID);
transactionStorage.changeKey(oldInternalRequestID, newInternalPendingRequestId, pendingRequest);
//only delete oldRequestID, no change.