oauth2-java-client

OAuth2 Java Client

Лицензия

Лицензия

Категории

Категории

Java Языки программирования H2 Данные Базы данных Безопасность OAuth2 CLI Взаимодействие с пользователем
Группа

Группа

com.clouway.security
Идентификатор

Идентификатор

oauth2-java-client-console
Последняя версия

Последняя версия

0.0.2
Дата

Дата

Тип

Тип

jar
Описание

Описание

oauth2-java-client
OAuth2 Java Client
Ссылка на сайт

Ссылка на сайт

https://github.com/clouway/oauth2-java-client
Система контроля версий

Система контроля версий

https://github.com/clouway/oauth2-java-client

Скачать oauth2-java-client-console

Как подключить последнюю версию

<!-- https://jarcasting.com/artifacts/com.clouway.security/oauth2-java-client-console/ -->
<dependency>
    <groupId>com.clouway.security</groupId>
    <artifactId>oauth2-java-client-console</artifactId>
    <version>0.0.2</version>
</dependency>
// https://jarcasting.com/artifacts/com.clouway.security/oauth2-java-client-console/
implementation 'com.clouway.security:oauth2-java-client-console:0.0.2'
// https://jarcasting.com/artifacts/com.clouway.security/oauth2-java-client-console/
implementation ("com.clouway.security:oauth2-java-client-console:0.0.2")
'com.clouway.security:oauth2-java-client-console:jar:0.0.2'
<dependency org="com.clouway.security" name="oauth2-java-client-console" rev="0.0.2">
  <artifact name="oauth2-java-client-console" type="jar" />
</dependency>
@Grapes(
@Grab(group='com.clouway.security', module='oauth2-java-client-console', version='0.0.2')
)
libraryDependencies += "com.clouway.security" % "oauth2-java-client-console" % "0.0.2"
[com.clouway.security/oauth2-java-client-console "0.0.2"]

Зависимости

compile (8)

Идентификатор библиотеки Тип Версия
org.jetbrains.kotlin : kotlin-stdlib jar 1.1.4-3
org.eclipse.jetty : jetty-webapp jar 9.3.14.v20161028
org.eclipse.jetty : jetty-server jar 9.3.14.v20161028
com.google.guava : guava jar 18.0
com.google.http-client : google-http-client-gson jar 1.22.0
com.google.http-client : google-http-client-appengine jar 1.22.0
com.google.http-client : google-http-client jar 1.23.0
com.google.oauth-client : google-oauth-client jar 1.23.0

test (3)

Идентификатор библиотеки Тип Версия
junit : junit jar 4.12
org.jmock : jmock-junit4 jar 2.6.0
com.github.rest-driver : rest-client-driver jar 1.1.45

Модули Проекта

Данный проект не имеет модулей.

OAuth2 java client

A client library which uses oauth client secrets to send authorized requests or generate access tokens

OAuth2 client for console apps

Send authorized request, with access token generated by Google OAuth server, using google http client library
OАuthClientConfig config = OАuthClientConfig
       .setClient("::client::")
       .setSecret("::secret::")
       .setScopes(setOf("scope1", "scope2"))
       //you can pass other implementation of CredentialsStore, like - CredentialsDatabase
       .setCredentialsStorage(LocalCredentialsFileStorage(filePath))
       .build()
             
HttpRequestFactory factory = NetHttpTransport().createRequestFactory(
         BearerTokenInterceptor.newGoogleInterceptor(config))
 
 // do HTTP call

NOTE: your client should have redirect url : 'http://localhost:8089/oauth2callback'

NOTE: if this code is invoked by gradle task(groovy) you task should contain this line: 'standardInput = System.in' or Scanner object will throw exception.

Generate credentials using Google OAuth server for offline apps
OАuthClientConfig config = OАuthClientConfig
       .setClient("::client::")
       .setSecret("::secret::")
       .setScopes(setOf("scope1", "scope2"))
       .setCredentialsStorage(LocalCredentialsFileStorage(filePath))
       .build()
       
GoogleOAuthCredentialsFactory factory = new GoogleOAuthCredentialsFactory(config);
Credentials credentials = factory.getCredentials();

// do some action with credentials

License

Copyright 2017 clouWay ood.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

https://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.

com.clouway.security

clouWay ood

Версии библиотеки

Версия
0.0.2
0.0.1