{"id":22394309,"url":"https://github.com/akamai/edgeauth-token-java","last_synced_at":"2025-09-15T03:39:53.759Z","repository":{"id":57716658,"uuid":"83901157","full_name":"akamai/EdgeAuth-Token-Java","owner":"akamai","description":"Akamai Authorization Token for Java","archived":false,"fork":false,"pushed_at":"2024-07-16T17:49:09.000Z","size":212,"stargazers_count":16,"open_issues_count":3,"forks_count":11,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-07-22T13:49:12.958Z","etag":null,"topics":["akamai","akamai-open","authorization","authtoken","java","signed-url","token"],"latest_commit_sha":null,"homepage":null,"language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/akamai.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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}},"created_at":"2017-03-04T14:58:07.000Z","updated_at":"2025-04-09T10:11:44.000Z","dependencies_parsed_at":"2024-03-05T18:44:30.129Z","dependency_job_id":"2e149ee9-437d-4782-a841-00c0245a3ffe","html_url":"https://github.com/akamai/EdgeAuth-Token-Java","commit_stats":null,"previous_names":["astinchoi/akamai-authtoken-java"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/akamai/EdgeAuth-Token-Java","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/akamai%2FEdgeAuth-Token-Java","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/akamai%2FEdgeAuth-Token-Java/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/akamai%2FEdgeAuth-Token-Java/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/akamai%2FEdgeAuth-Token-Java/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/akamai","download_url":"https://codeload.github.com/akamai/EdgeAuth-Token-Java/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/akamai%2FEdgeAuth-Token-Java/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":268024610,"owners_count":24183149,"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","status":"online","status_checked_at":"2025-07-31T02:00:08.723Z","response_time":66,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["akamai","akamai-open","authorization","authtoken","java","signed-url","token"],"created_at":"2024-12-05T05:09:41.569Z","updated_at":"2025-07-31T10:32:36.895Z","avatar_url":"https://github.com/akamai.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# EdgeAuth-Token-Java: Akamai Edge Authorization Token for Java\n\n[![Maven Central](https://img.shields.io/badge/maven%20central-1.0.0-brightgreen.svg)](http://search.maven.org/#artifactdetails%7Ccom.akamai%7Cedgeauth%7C1.0.0%7C)\n[![Build Status](https://github.com/akamai/EdgeAuth-Token-Java/actions/workflows/check.yml/badge.svg)\n[![License](http://img.shields.io/:license-apache-blue.svg)](https://github.com/akamai/EdgeAuth-Token-Java/blob/master/LICENSE)\n\nEdgeAuth-Token-Java is Akamai Edge Authorization Token in the HTTP Cookie, Query String and Header for a client.\nYou can configure it in the Property Manager at https://control.akamai.com.\nIt's a behavior which is Auth Token 2.0 Verification.\n\nEdgeAuth-Token-Java supports Java 8+.\n\n## Build\n[Click Here](http://search.maven.org/#artifactdetails%7Ccom.akamai%7Cedgeauth%7C0.2.0%7C)\n\n\n## Example\n```java\nimport com.akamai.edgeauth.EdgeAuth;\nimport com.akamai.edgeauth.EdgeAuthBuilder;\nimport com.akamai.edgeauth.EdgeAuthException;\n\n\npublic class EdgeAuthExample {\n  public static void main(String[] args) {\n    String hostname = \"YourAkamaizedHostname\";\n    String ET_ENCRYPTION_KEY = \"YourEncryptionKey\";\n    long duration = 500L; // 500 seconds\n\n    // Below examples here ..\n  }\n}\n```\n\n* ET_ENCRYPTION_KEY must be hexadecimal digit string with even-length.\n* Don't expose ET_ENCRYPTION_KEY on the public repository.\n\n\n#### URL parameter option\n```java\ntry {\n  EdgeAuth ea = new EdgeAuthBuilder()\n      .key(ET_ENCRYPTION_KEY)\n      .windowSeconds(duration)\n      .escapeEarly(true)\n      .build();\n\n  /******** \n  1) Cookie \n  *********/\n  String path = \"/akamai/edgeauth\";\n  String token = ea.generateURLToken(path);\n  String url = String.format(\"http(s)://%s%s\", hostname, path);\n  String cookie = String.format(\"%s=%s\", ea.getTokenName(), token);\n  // =\u003e Link or Request \"url\" /w \"cookie\"\n\n  /************** \n  2) Query String \n  ***************/\n  String path = \"/akamai/edgeauth\";\n  String token = ea.generateURLToken(path);\n  String url = String.format(\"http(s)://%s%s?%s=%s\", hostname, path,\n    ea.getTokenName(), token);\n  // If url has a query string which isn't for the token, be aware of the string formatter and symbol(? and \u0026).\n  // =\u003e Link or Request \"url\" /w Query string\n} catch (EdgeAuthException e) {\n  e.printStackTrace();\n}\n```\n\n* 'Escape token input' option in the Property Manager corresponds to 'escapeEarly' in the code.  \n    Escape token input (on) == escapeEarly (true)  \n    Escape token input (off) == escapeEarly (false)\n* In [Example 2] for Query String, it's only okay for 'Ignore query string' option (on).\n* If you want to 'Ignore query string' option (off) using query string as your token, Please contact your Akamai representative.\n\n\n#### ACL(Access Control List) parameter option\n```java\ntry {\n  EdgeAuth ea = new EdgeAuthBuilder()\n      .key(encrpytionKey)\n      .windowSeconds(duration)\n      .build();\n\n  /******************\n  3) Header using '*' \n  *******************/\n  String acl = \"/akamai/edgeauth/list/*\"; //*/\n  String token = ea.generateACLToken(acl);\n  String url = String.format(\"http(s)://%s%s\", hostname, \"/akamai/edgeauth/list/something\");\n  String header = String.format(\"%s: %s\", ea.getTokenName(), token);\n  // =\u003e Link or Request \"url\" /w \"header\"\n\n  /************************* \n  4) Cookie Delimited by '!'\n  **************************/\n  String acl2[] = { \"/akamai/edgeauth\", \"/akamai/edgeauth/list/*\" };\n  String token = ea.generateACLToken(acl2);\n  String url = String.format(\"http(s)://%s%s\", hostname, \"/akamai/edgeauth/list/something2\");\n  String cookie = String.format(\"%s=%s\", ea.getTokenName(), token);\n  // =\u003e Link or Request \"url\" /w \"cookie\"\n} catch (EdgeAuthException e) {\n  e.printStackTrace();\n}\n```\n\n* ACL can use the wildcard(\\*, ?) in the path.\n* Don't use '!' in your path because it's ACL Delimiter.\n* Use 'escapeEarly=false' as default setting but it doesn't matter turning on/off 'Escape token input' option in the Property Manager\n\n\n## Usage\n\n#### EdgeAuth, EdgeAuthBuilder Class\n\n| Parameter | Description |\n|-----------|-------------|\n| tokenType | Select a preset. (Not Supported Yet) |\n| tokenName | Parameter name for the new token. [ Default: \\_\\_token\\_\\_ ] |\n| key | Secret required to generate the token. It must be hexadecimal digit string with even-length. |\n| algorithm  | Algorithm to use to generate the token. (\"sha1\", \"sha256\", or \"md5\") [ Default: \"sha256\" ] |\n| salt | Additional data validated by the token but NOT included in the token body. (It will be deprecated) |\n| ip | IP Address to restrict this token to. (Troublesome in many cases (roaming, NAT, etc) so not often used) |\n| payload | Additional text added to the calculated digest. |\n| sessionId | The session identifier for single use tokens or other advanced cases. |\n| startTime | What is the start time? (Use EdgeAuth.NOW for the current time) |\n| endTime | When does this token expire? endTime overrides windowSeconds |\n| windowSeconds | How long is this token valid for? |\n| fieldDelimiter | Character used to delimit token body fields. [ Default: ~ ] |\n| aclDelimiter | Character used to delimit acl. [ Default: ! ] |\n| escapeEarly | Causes strings to be url encoded before being used. |\n| verbose | Print all parameters. |\n\n#### EdgeAuth Static Variable\n```java\npublic static final Long NOW = 0L; // When using startTime, 0L means \"from NOW\".\n```\n\n#### EdgeAuth's Method\n| Method | Description |\n|--------|-------------|\n| generateURLToken(String url) | Single URL path. |\n| generateACLToken(String acl) | Single URL path - can use the wildcard (*, ?) |\n| generateACLToken(String[] acl) | Multi URL paths - can use the wildcard |\n\nReturns the authorization token string.\n\n\n## Test\n\"src/test\" directory is only for the internal test.\n\n\n## Others\nIf you use the **Segmented Media Protection** behavior in AMD(Adaptive Media Delivery) Product, **tokenName** should be '**hdnts**'.\n\n## License\nCopyright 2018 Akamai Technologies, Inc.  All rights reserved.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n    http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fakamai%2Fedgeauth-token-java","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fakamai%2Fedgeauth-token-java","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fakamai%2Fedgeauth-token-java/lists"}