Skip to content

renefatuaki/oauth1-authorization-header-builder

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

OAuth1AuthorizationHeaderBuilder

Java CI with Maven Maven Central Version javadoc

A Java library for building OAuth1 authorization headers.

Getting the latest release

Add the following dependency to your pom.xml:

<dependency>
	<groupId>io.github.renefatuaki</groupId>
	<artifactId>oauth1-authorization-header-builder</artifactId>
	<version>1.0.0</version>
</dependency>

Alternatively, you can pull it from the central Maven repositories: Maven Central Repository

Usage

Example

Creating an OAuth1 Authorization Header for Twitter media upload endpoint:

String authorization = new OAuth1AuthorizationHeaderBuilder()
		.setHttpMethod("POST")
		.setUrl("https://upload.twitter.com/1.1/media/upload.json")
		.setConsumerSecret(consumerSecret)
		.setTokenSecret(accessTokenSecret)
		.addParameter("oauth_consumer_key", consumerKey)
		.addParameter("oauth_token", accessToken)
		.addQueryParameter("additional_owners=" + id)
		.build();

License

This code is licensed under the Apache License v2.

Releases

No releases published

Packages

No packages published

Languages