Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HMAC token generation #1

Open
mike-north opened this issue Apr 27, 2016 · 0 comments
Open

HMAC token generation #1

mike-north opened this issue Apr 27, 2016 · 0 comments

Comments

@mike-north
Copy link

mike-north commented Apr 27, 2016

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

@mike-north mike-north changed the title HMAC Signing HMAC token generation Apr 27, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant