{"id":21647449,"url":"https://github.com/fitomad/mapkitjs-jwt-token-generator","last_synced_at":"2025-03-20T00:58:04.220Z","repository":{"id":74267625,"uuid":"137220592","full_name":"fitomad/mapkitjs-jwt-token-generator","owner":"fitomad","description":"A python script that generate a JWT token for the new MapKit JS web API from Apple","archived":false,"fork":false,"pushed_at":"2018-06-13T14:44:30.000Z","size":37,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-25T05:09:36.576Z","etag":null,"topics":["jwt","jwt-token","mapkit","mapkit-js"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/fitomad.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-06-13T13:38:00.000Z","updated_at":"2019-01-18T09:42:06.000Z","dependencies_parsed_at":"2023-07-12T04:30:38.770Z","dependency_job_id":null,"html_url":"https://github.com/fitomad/mapkitjs-jwt-token-generator","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fitomad%2Fmapkitjs-jwt-token-generator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fitomad%2Fmapkitjs-jwt-token-generator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fitomad%2Fmapkitjs-jwt-token-generator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fitomad%2Fmapkitjs-jwt-token-generator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fitomad","download_url":"https://codeload.github.com/fitomad/mapkitjs-jwt-token-generator/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244531013,"owners_count":20467391,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["jwt","jwt-token","mapkit","mapkit-js"],"created_at":"2024-11-25T06:50:05.463Z","updated_at":"2025-03-20T00:58:04.202Z","avatar_url":"https://github.com/fitomad.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# MapKit JS JWS token generator\n\n![Python 2.7](https://img.shields.io/badge/python-2.6-blue.svg) ![Python 3.6](https://img.shields.io/badge/python-3.6-blue.svg) ![MapKit JS](https://img.shields.io/badge/MapKit%20JS-5.X%20beta-yellow.svg)\n\nA python script that generates a JWT token for the new [MapKit JS](https://developer.apple.com/documentation/mapkitjs) web API from Apple. The token generated is valid for **180 days**.\n\nIn order to run the script this packages must be installed on your system:\n\n* [PyJWT](https://github.com/jpadilla/pyjwt)\n* [Cryptography](https://github.com/pyca/cryptography)\n\nYou can check it with  `pip list` command on your Terminal. If not presented install it with\n\n```\nsudo pip install pyjwt --user\nsudo pip install cryptography --user \n```\n\n## Configuration\n\nIn order to generate a valid JWS token you must provide 3 fields and an optional, but recommended, one. The mandatory fields are...\n\n1. Private Key file. The file with .p8 extension downloaded from Apple developer website.\n2. Your Apple Team ID. Available in your developer profile.\n3. MapKit Api Key ID.\n\nThe optional is a domain restriction.\n\n1. Origin. URL where your mapkit web is hosted. If yoor website is under a subdomain you **must include it**. \n\n\n```python\n# Mandatory fileds. \n\nprivate_key_file_path = \"[YOUR_PRIVATE_KEY_FILE].p8\"\napple_team_id = \"YOUR_APPLE_TEAM_ID\"\nmapkit_key_id = \"YOUR_MAPKIT_KEY_ID\"\n\n# Optional but recommended fields.\n\norigin_domain = \"http://subdomain.yourdomain.com\"\n```\n\n## Run Script\n\nOpen Terminal app on your macOS or Command Prompt on Windows and type the follwing command\n\n```\npython mapkitjs_token_generator.py\n```\n\nA couple of seconds later you will see something like this\n\n![Script output](https://github.com/fitomad/mapkitjs-jwt-token-generator/blob/master/Screenshots/Captura.JPG)\n\n## Links\n\n* Getting and Using a Mapkit JS Key. [WDC 2018 session](https://developer.apple.com/videos/play/wwdc2018/508/)\n* Introducing MapKit JS. [WWDC 2018 session](https://developer.apple.com/videos/play/wwdc2018/212/)\n\n* JWT Protocol. Website with [libraries](https://jwt.io/#libraries-io) and a [*token sandbox*](https://jwt.io/#debugger-io)\n\n## Contact\n\nAny question or suggestion? You will find me on twitter at [@fitomad](https://twitter.com/fitomad)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffitomad%2Fmapkitjs-jwt-token-generator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffitomad%2Fmapkitjs-jwt-token-generator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffitomad%2Fmapkitjs-jwt-token-generator/lists"}