Skip to content

HMAC token generation #1

@mike-north

Description

@mike-north

I'm not sure where the best place is to put this is (maybe a utility method on the ExIntercom global?), but it's needed for "secure mode" messaging through the web or native clients.

It doesn't need to be complicated --- just something like this

defmodule ExIntercom do
  def hmac_tokenize(value, intercom_secure_key) do
    :sha256
    |> :crypto.hmac(intercom_secure_key, value)
    |> Base.encode16
  end  
end

Happy to open up a PR for this if you feel it's a good idea

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions