{"action":"closed","issue":{"url":"https://api.github.com/repos/simonh1000/elm-jwt/issues/1","repository_url":"https://api.github.com/repos/simonh1000/elm-jwt","labels_url":"https://api.github.com/repos/simonh1000/elm-jwt/issues/1/labels{/name}","comments_url":"https://api.github.com/repos/simonh1000/elm-jwt/issues/1/comments","events_url":"https://api.github.com/repos/simonh1000/elm-jwt/issues/1/events","html_url":"https://github.com/simonh1000/elm-jwt/issues/1","id":137368217,"number":1,"title":"JWT uses base64url encoding, not base64 encoding","user":{"login":"finlay","id":777798,"avatar_url":"https://avatars.githubusercontent.com/u/777798?v=3","gravatar_id":"","url":"https://api.github.com/users/finlay","html_url":"https://github.com/finlay","followers_url":"https://api.github.com/users/finlay/followers","following_url":"https://api.github.com/users/finlay/following{/other_user}","gists_url":"https://api.github.com/users/finlay/gists{/gist_id}","starred_url":"https://api.github.com/users/finlay/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/finlay/subscriptions","organizations_url":"https://api.github.com/users/finlay/orgs","repos_url":"https://api.github.com/users/finlay/repos","events_url":"https://api.github.com/users/finlay/events{/privacy}","received_events_url":"https://api.github.com/users/finlay/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2016-02-29T20:45:35Z","updated_at":"2016-03-01T16:49:59Z","closed_at":"2016-03-01T16:49:59Z","body":"base64 and base64url encoding are different in the last two characters used, \r\nie, base64 -> '+/', or base64url ->  '-_'\r\nsee https://en.wikipedia.org/wiki/Base64#URL_applications\r\n\r\nTo make the decode  Jwt.decodeToken function work I needed to add this simple function to pre-process the token: \r\n``` elm\r\nunurl = \r\n    let fix c = \r\n          case c of \r\n            '-' -> '+'\r\n            '_' -> '/'\r\n            c   -> c\r\n    in String.map fix\r\n```\r\n\r\nThen it works great.\r\n\r\nThis fix could be added to the elm-jwt library, or the base64 library expanded to include a urldecode version."}}