Last active
August 21, 2016 22:24
-
-
Save enilsen16/c60caec6d021b72fbb016906c5c36e3c to your computer and use it in GitHub Desktop.
Revisions
-
enilsen16 revised this gist
Aug 21, 2016 . No changes.There are no files selected for viewing
-
enilsen16 created this gist
Aug 21, 2016 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,17 @@ defmodule TwilioToken do import Joken @app Application.get_env(:speaker, :twilio_app) @sid Application.get_env(:ex_twilio, :account_sid) @token Application.get_env(:ex_twilio, :auth_token) def generate do %{scope: "scope:client:outgoing?appSid=#{@app}"} |> token |> with_iss(@sid) |> with_signer(hs256(@token)) |> with_exp |> sign |> get_compact end end