Happy !

zeroflag / PBMAuthenticator

Project infos

License MIT
Tags authentication
Creation date 2016-06-09
Website https://www.passbyme.net

Monticello registration

About PBMAuthenticator

PBMAuthenticator

PBMAuthenticator is library that lets you use the PassBy[ME] two-factor authentication service from Pharo Smalltalk.

Quick start

Install PBMAuthenticator

Gofer it
    smalltalkhubUser: 'zeroflag' project: 'PBMAuthenticator';
    configuration;
    loadDevelopment.

Send a 2nd factor authentication request to the user's phone

  • Sign up for the PassBy[ME] service
  • Create an application and download the Application PFX (authentication certificate-key pair )
  • Convert the PFX to PEM using the following openssl command: openssl pkcs12 -in input.pfx -out output.pem -nodes
  • Start an authentication session with the following code
authenticator := PBMAuthenticator pemPath: '/path/to/app.pem'.
sessionId := authenticator startAuthentication: { #userId -> 'user1' }.
authenticator progress: sessionId.

This will start a new authentication session by sending a PassBy[ME] notification to the user's smartphone. The user can either accept or deny the authentication. The authentication result can be accessed by sending the progress: message with the sessionId as an argument. This will answer one of the following symbol: PENDING, APPROVED, DENIED, TIMEOUT, CANCELLED.

Messaging service

You can send general messages or esign requests to to users. For more information check the PassBy[ME] documentation.

messenger := PBMMessenger pemPath: '/path/to/app.pem'.
trackingInfo := messenger send: { 
    #recipients -> {'user01'}.         "list of recipient user ids"
    #subject -> 'My subject' .
    #body -> 'My body'
    #availability -> 86400.            "message availability in seconds"
    #type -> #message.                 "message type: #message or #esign"
}.

"request a tracking info again"
messenger track: (trackingInfo at: #messageId).