Commit 601cf561 authored by Ivar Derksen's avatar Ivar Derksen
Browse files

Include clientReturnURL in session request

parent 9270a83a
...@@ -83,3 +83,6 @@ func (h *keyshareEnrollmentHandler) KeyshareEnrollmentMissing(manager irma.Schem ...@@ -83,3 +83,6 @@ func (h *keyshareEnrollmentHandler) KeyshareEnrollmentMissing(manager irma.Schem
func (h *keyshareEnrollmentHandler) UnsatisfiableRequest(request irma.SessionRequest, ServerName irma.TranslatedString, missing MissingAttributes) { func (h *keyshareEnrollmentHandler) UnsatisfiableRequest(request irma.SessionRequest, ServerName irma.TranslatedString, missing MissingAttributes) {
h.fail(errors.New("Keyshare enrollment failed: unsatisfiable")) h.fail(errors.New("Keyshare enrollment failed: unsatisfiable"))
} }
func (h *keyshareEnrollmentHandler) ClientReturnURLFound(clientReturnURL string) {
h.fail(errors.New("Keyshare enrollment session unexpectedly found an external return url"))
}
...@@ -30,6 +30,7 @@ type PinHandler func(proceed bool, pin string) ...@@ -30,6 +30,7 @@ type PinHandler func(proceed bool, pin string)
// A Handler contains callbacks for communication to the user. // A Handler contains callbacks for communication to the user.
type Handler interface { type Handler interface {
StatusUpdate(action irma.Action, status irma.Status) StatusUpdate(action irma.Action, status irma.Status)
ClientReturnURLFound(clientReturnURL string)
Success(result string) Success(result string)
Cancelled() Cancelled()
Failure(err *irma.SessionError) Failure(err *irma.SessionError)
...@@ -309,6 +310,12 @@ func (session *session) processSessionInfo() { ...@@ -309,6 +310,12 @@ func (session *session) processSessionInfo() {
go session.doSession(proceed) go session.doSession(proceed)
}) })
session.Handler.StatusUpdate(session.Action, irma.StatusConnected) session.Handler.StatusUpdate(session.Action, irma.StatusConnected)
// Handle ClientReturnURL if one is found in the session request
if session.request.Base().ClientReturnURL != "" {
session.Handler.ClientReturnURLFound(session.request.Base().ClientReturnURL)
}
switch session.Action { switch session.Action {
case irma.ActionDisclosing: case irma.ActionDisclosing:
session.Handler.RequestVerificationPermission( session.Handler.RequestVerificationPermission(
......
...@@ -34,6 +34,8 @@ type BaseRequest struct { ...@@ -34,6 +34,8 @@ type BaseRequest struct {
legacy bool // Whether or not this was deserialized from a legacy (pre-condiscon) request legacy bool // Whether or not this was deserialized from a legacy (pre-condiscon) request
Type Action `json:"type,omitempty"` // Session type, only used in legacy code Type Action `json:"type,omitempty"` // Session type, only used in legacy code
ClientReturnURL string `json:"clientReturnUrl,omitempty"` // URL to proceed to when IRMA session is completed
} }
// An AttributeCon is only satisfied if all of its containing attribute requests are satisfied. // An AttributeCon is only satisfied if all of its containing attribute requests are satisfied.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment