IPWorks EDI 2020 macOS Edition

Questions / Feedback?

TokenAuthentication Event

Fired when the client makes use of UsernameToken authentication.

Syntax

func onTokenAuthentication(user: String, password: inout String, passwordType: String, accept: inout Bool)

Remarks

This event fires when a client sends a request that includes UsernameToken authentication. This is typically only used by clients initiating a pull request.

User identifies the user.

Password should be set from within the event if PasswordType is 0 (digest). This parameter can be read when PasswordType is 1 (text).

PasswordType specifies the type of password. Possible values are:

  • 0 (Digest)
  • 1 (Text)

Accept may be set to manually accept the request.

When PasswordType is 0 (Digest) set the Password parameter to the plaintext password. Do not set Accept The class will hash the provided password value and compare it to the value in the request. If it matched the class will accept the request. If it does not match the class will populate Errors with an error indicating authentication has failed.

When PasswordType is 1 (Text) the Password parameter will hold the exact value received in the request. Inspect Password and determine whether to accept the request. To accept the request set Accept to True.

After this event fires if authentication failed Errors will contain an appropriate error. Send the errors back to the client by calling SendResponse.

Copyright (c) 2022 /n software inc. - All rights reserved.
IPWorks EDI 2020 macOS Edition - Version 20.0 [Build 8203]