[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Shared Secret with in a Soap process.




   I need to get a token for a Shared Secret to acces a Web Service but
   can not fine anything in regards to using it within a soap request.
   I have done it by using a Password but since that is not hiden I need
   to change it.


   Below is an example if have for a VB code but i am using the iSeries.


   Does anyone know where I can find or know how to set up my soap to get
   the token for a shared secret?


   VB Example--------------------

   Private Function GetToken(ByVal User As String) As String

           If Token = "" Or User <> ContractAuthentication.User Then

               Dim MD5Input As String

               MD5Input = User & ":"

               MD5Input += ":"

               MD5Input += ":"

               MD5Input += GetTokenDate() & ":"

               MD5Input += "MD5:"

               MD5Input += SharedSecret

               Dim MD5Provider As New
   System.Security.Cryptography.MD5CryptoServiceProvider

               Dim Bytes As Byte() =
   System.Text.Encoding.UTF8.GetBytes(MD5Input)

               Bytes = MD5Provider.ComputeHash(Bytes)

               Token = Convert.ToBase64String(Bytes)

               ContractAuthentication.User = User

           End If

           Return Token

       End Function
   Best regards,
   B
-----------------------------------------------------------------------
This is the FTPAPI mailing list.  To unsubscribe, please go to:
http://www.scottklement.com/mailman/listinfo/ftpapi
-----------------------------------------------------------------------