MCPcopy Index your code
hub / github.com/akamai/AkamaiOPEN-edgegrid-java

github.com/akamai/AkamaiOPEN-edgegrid-java @6.0.4

Chat with this repo
repository ↗ · DeepWiki ↗ · release 6.0.4 ↗ · + Follow
304 symbols 1,177 edges 41 files 97 documented · 32%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

EdgeGrid Client for Java

This library implements an Authentication handler for the Akamai EdgeGrid Authentication scheme in Java.

Install

To use AkamaiOPEN EdgeGrid for Java, you need Java version 11+.

Maven Central Javadocs

Modules

This project contains core implementation modules and binding modules to specific HTTP client libraries.

Core

Module Description
edgegrid-signer-core The core signing implementation and base classes used by an individual library.
edgegrid-reader A configuration file reader that reads credentials from an .edgerc file. This file is an INI file with credential sections and properties.

See the Authentication section for details on using the classes from these modules.

Bindings

Module Description
edgegrid-signer-apache-http-client A binding for Apache HTTP Client before version 5.0.0.
edgegrid-signer-apache-http-client5 A binding for Apache HTTP Client version 5.x.
edgegrid-signer-async-http-client A binding for Async HTTP Client.
edgegrid-signer-google-http-client A binding for Google HTTP Client.
edgegrid-signer-rest-assured A binding for REST-assured.

Note: Several similar libraries for signing requests exist for popular programming languages, and you can find them at https://github.com/akamai?q=edgegrid.

Authentication

You can get the authentication credentials through an API client. Requests to the API are marked with a timestamp and a signature and are executed immediately.

  1. Create authentication credentials.

  2. Place your credentials in an EdgeGrid resource file ~/.edgerc, in the [default] section.

    [default] client_secret = C113nt53KR3TN6N90yVuAgICxIRwsObLi0E67/N8eRN= host = akab-h05tnam3wl42son7nktnlnnx-kbob3i3v.luna.akamaiapis.net access_token = akab-acc35t0k3nodujqunph3w7hzp7-gtm6ij client_token = akab-c113ntt0k3n4qtari252bfxxbsl-yvsdj

    In addition to the required properties, an .edgerc file can optionally contain a max-body property. If absent, the implied default is 131072.

    If you've inherited a max-body value of 8192 in your .edgerc file, that value is incorrect. If you encounter signature mismatch errors with POST requests, try removing that value from the file before trying anything else.

  3. Use your local .edgerc by providing the path to your resource file and credentials' section header in the EdgeRcClientCredentialProvider class from the edgerc-reader module.

    java ClientCredential credential = EdgeRcClientCredentialProvider .fromEdgeRc("path/to/.edgerc", "your-section-header") .getClientCredential(null);

    Or hard code your credentials and pass the values to the ClientCredential class from the edgegrid-signer-core module.

    java ClientCredential credential = ClientCredential.builder() .clientSecret("C113nt53KR3TN6N90yVuAgICxIRwsObLi0E67/N8eRN=") .host("akab-h05tnam3wl42son7nktnlnnx-kbob3i3v.luna.akamaiapis.net") .accessToken("akab-acc35t0k3nodujqunph3w7hzp7-gtm6ij") .clientToken("akab-c113ntt0k3n4qtari252bfxxbsl-yvsdj") .build();

Use

Using one of the bindings to the HTTP client libraries, provide the path to your .edgerc, your credentials' section header, and the appropriate endpoint information.

The following is an example of making an HTTP call with Apache HTTP Client 5, one of the HTTP client libraries for Java that our EdgeGrid plug-in supports.

import java.io.IOException;

import org.apache.commons.configuration2.ex.ConfigurationException;
import org.apache.hc.client5.http.classic.methods.HttpGet;
import org.apache.hc.client5.http.impl.classic.BasicHttpClientResponseHandler;
import org.apache.hc.client5.http.impl.classic.CloseableHttpClient;
import org.apache.hc.client5.http.impl.classic.HttpClientBuilder;

import com.akamai.edgegrid.signer.ClientCredential;
import com.akamai.edgegrid.signer.EdgeRcClientCredentialProvider;
import com.akamai.edgegrid.signer.apachehttpclient5.ApacheHttpClient5EdgeGridInterceptor;
import com.akamai.edgegrid.signer.apachehttpclient5.ApacheHttpClient5EdgeGridRoutePlanner;

public class GetUserProfile {
    public static void main(String[] args) throws ConfigurationException, IOException {
        ClientCredential credential = EdgeRcClientCredentialProvider
                .fromEdgeRc("~/.edgerc", "default")
                .getClientCredential(null);

        try (CloseableHttpClient client = HttpClientBuilder.create()
                .addRequestInterceptorFirst(new ApacheHttpClient5EdgeGridInterceptor(credential))
                .setRoutePlanner(new ApacheHttpClient5EdgeGridRoutePlanner(credential))
                .build()) {

            String uri = "https://" + credential.getHost() + "/identity-management/v3/user-profile";
            System.out.println(client.execute(new HttpGet(uri), new BasicHttpClientResponseHandler()));
        }
    }
}

For details on how to make a call using this and other bindings to the HTTP client libraries, see each binding module's README.md file.

Reporting issues

To report an issue or make a suggestion, create a new GitHub issue.

License

Copyright 2026 Akamai Technologies, Inc. All rights reserved.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use these files except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Extension points exported contracts — how you extend this code

ClientCredentialProvider (Interface)
This interface provides a mechanism to select a ClientCredential. Implementations of {@link AbstractEdgeGrid [5 implementers]
edgegrid-signer-core/src/main/java/com/akamai/edgegrid/signer/ClientCredentialProvider.java

Core symbols most depended-on inside this repo

build
called by 69
edgegrid-signer-core/src/main/java/com/akamai/edgegrid/signer/Request.java
header
called by 46
edgegrid-signer-core/src/main/java/com/akamai/edgegrid/signer/Request.java
getHeaders
called by 37
edgegrid-signer-core/src/main/java/com/akamai/edgegrid/signer/Request.java
builder
called by 34
edgegrid-signer-core/src/main/java/com/akamai/edgegrid/signer/Request.java
method
called by 34
edgegrid-signer-core/src/main/java/com/akamai/edgegrid/signer/Request.java
uri
called by 33
edgegrid-signer-core/src/main/java/com/akamai/edgegrid/signer/Request.java
body
called by 22
edgegrid-signer-core/src/main/java/com/akamai/edgegrid/signer/Request.java
builder
called by 21
edgegrid-signer-core/src/main/java/com/akamai/edgegrid/signer/ClientCredential.java

Shape

Method 256
Class 45
Function 2
Interface 1

Languages

Java99%
Python1%

Modules by API surface

edgegrid-signer-apache-http-client/src/test/java/com/akamai/edgegrid/signer/apachehttpclient/RestAssuredIntegrationTest.java25 symbols
edgegrid-signer-rest-assured/src/test/java/com/akamai/edgegrid/signer/restassured/RestAssuredEdgeGridFilterIntegrationTest.java24 symbols
edgegrid-signer-core/src/main/java/com/akamai/edgegrid/signer/ClientCredential.java23 symbols
edgegrid-signer-core/src/main/java/com/akamai/edgegrid/signer/EdgeGridV1Signer.java20 symbols
edgegrid-signer-core/src/main/java/com/akamai/edgegrid/signer/Request.java19 symbols
edgegrid-signer-core/src/test/java/com/akamai/edgegrid/signer/RequestTest.java12 symbols
edgegrid-signer-rest-assured/src/main/java/com/akamai/edgegrid/signer/restassured/RestAssuredEdgeGridRequestSigner.java10 symbols
edgegrid-signer-core/src/test/java/com/akamai/edgegrid/signer/AbstractEdgeGridRequestSignerTest.java10 symbols
edgegrid-signer-core/src/main/java/com/akamai/edgegrid/signer/AbstractEdgeGridRequestSigner.java10 symbols
edgerc-reader/src/test/java/com/akamai/edgegrid/signer/EdgeRcClientCredentialProviderTest.java9 symbols
edgegrid-signer-google-http-client/src/main/java/com/akamai/edgegrid/signer/googlehttpclient/GoogleHttpClientEdgeGridRequestSigner.java9 symbols
edgegrid-signer-apache-http-client5/src/main/java/com/akamai/edgegrid/signer/apachehttpclient5/ApacheHttpClient5EdgeGridRequestSigner.java9 symbols

For agents

$ claude mcp add AkamaiOPEN-edgegrid-java \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact