{"action":"created","issue":{"url":"https://api.github.com/repos/bryanjos/joken/issues/117","repository_url":"https://api.github.com/repos/bryanjos/joken","labels_url":"https://api.github.com/repos/bryanjos/joken/issues/117/labels{/name}","comments_url":"https://api.github.com/repos/bryanjos/joken/issues/117/comments","events_url":"https://api.github.com/repos/bryanjos/joken/issues/117/events","html_url":"https://github.com/bryanjos/joken/issues/117","id":138544999,"number":117,"title":"Example to use with RS256 for Google Cloud Platform","user":{"login":"sashaafm","id":3422400,"avatar_url":"https://avatars.githubusercontent.com/u/3422400?v=3","gravatar_id":"","url":"https://api.github.com/users/sashaafm","html_url":"https://github.com/sashaafm","followers_url":"https://api.github.com/users/sashaafm/followers","following_url":"https://api.github.com/users/sashaafm/following{/other_user}","gists_url":"https://api.github.com/users/sashaafm/gists{/gist_id}","starred_url":"https://api.github.com/users/sashaafm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sashaafm/subscriptions","organizations_url":"https://api.github.com/users/sashaafm/orgs","repos_url":"https://api.github.com/users/sashaafm/repos","events_url":"https://api.github.com/users/sashaafm/events{/privacy}","received_events_url":"https://api.github.com/users/sashaafm/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":11,"created_at":"2016-03-04T18:15:05Z","updated_at":"2016-08-08T12:25:14Z","closed_at":"2016-03-25T14:11:00Z","body":"Hello, I'm trying to use Joken to get access tokens for Google Cloud Platform. I can't seem to use RS256 (which is what the docs say must be used). Could you please help me with this, maybe by providing an example?\r\n```\r\n\r\n    my_token = %{iss: \"serviceEmail\", \r\n                 scope: \"theScope\",\r\n                 aud: \"https://www.googleapis.com/oauth2/v4/token\",\r\n                 exp: 1457116200,\r\n                 iat: 1457114100\r\n                }\r\n               |> token\r\n               |> with_signer(rs256(\"my_secret\"))\r\n```"},"comment":{"url":"https://api.github.com/repos/bryanjos/joken/issues/comments/238220226","html_url":"https://github.com/bryanjos/joken/issues/117#issuecomment-238220226","issue_url":"https://api.github.com/repos/bryanjos/joken/issues/117","id":238220226,"user":{"login":"cs-victor-nascimento","id":7049728,"avatar_url":"https://avatars.githubusercontent.com/u/7049728?v=3","gravatar_id":"","url":"https://api.github.com/users/cs-victor-nascimento","html_url":"https://github.com/cs-victor-nascimento","followers_url":"https://api.github.com/users/cs-victor-nascimento/followers","following_url":"https://api.github.com/users/cs-victor-nascimento/following{/other_user}","gists_url":"https://api.github.com/users/cs-victor-nascimento/gists{/gist_id}","starred_url":"https://api.github.com/users/cs-victor-nascimento/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cs-victor-nascimento/subscriptions","organizations_url":"https://api.github.com/users/cs-victor-nascimento/orgs","repos_url":"https://api.github.com/users/cs-victor-nascimento/repos","events_url":"https://api.github.com/users/cs-victor-nascimento/events{/privacy}","received_events_url":"https://api.github.com/users/cs-victor-nascimento/received_events","type":"User","site_admin":false},"created_at":"2016-08-08T12:25:14Z","updated_at":"2016-08-08T12:25:14Z","body":"Perhaps we should add this to the Readme as a an added example. Wdyt\n@bryanjos?\n\nEm 08/08/2016 1:20 AM, \"Gareth Townsend\" <notifications@github.com>\nescreveu:\n\n> I just ran into this myself. After some hunting around I found the\n> from_pem function in JOSE.JWK which makes this nice and simple if you\n> already have a PEM encoded RSA key:\n>\n>     key = Application.get_env(:my_application, :key)\n>     |> JOSE.JWK.from_pem\n>\n>     token = %{name: \"name\"}\n>     |> token\n>     |> with_signer(rs256(key))\n>     |> sign\n>     |> get_compact\n>\n> Just thought I'd leave this here for anyone else who finds this issue and\n> is wondering how to do this when you have a string instead of a .pem file.\n>\n> —\n> You are receiving this because you commented.\n> Reply to this email directly, view it on GitHub\n> <https://github.com/bryanjos/joken/issues/117#issuecomment-238138916>, or mute\n> the thread\n> <https://github.com/notifications/unsubscribe-auth/AGuSANsxEZ6OyN5C6_leWlyZsCzzljVsks5qdq6MgaJpZM4Hpmar>\n> .\n>\n"}}
{"actor":{"display_login":"cs-victor-nascimento"}}