Webasyst auth (kotlin)

Webasyst auth client - kotlin utilites

Лицензия

Лицензия

https://www.gnu.org/licenses/lgpl-3.0.html
Группа

Группа

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

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

auth-kt
Последняя версия

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

1.0.0
Дата

Дата

Тип

Тип

aar
Описание

Описание

Webasyst auth (kotlin)
Webasyst auth client - kotlin utilites
Ссылка на сайт

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

https://github.com/1312inc/Webasyst-X-Android-Library
Система контроля версий

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

https://github.com/1312inc/Webasyst-X-Android-Library

Скачать auth-kt

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

<!-- https://jarcasting.com/artifacts/com.webasyst/auth-kt/ -->
<dependency>
    <groupId>com.webasyst</groupId>
    <artifactId>auth-kt</artifactId>
    <version>1.0.0</version>
    <type>aar</type>
</dependency>
// https://jarcasting.com/artifacts/com.webasyst/auth-kt/
implementation 'com.webasyst:auth-kt:1.0.0'
// https://jarcasting.com/artifacts/com.webasyst/auth-kt/
implementation ("com.webasyst:auth-kt:1.0.0")
'com.webasyst:auth-kt:aar:1.0.0'
<dependency org="com.webasyst" name="auth-kt" rev="1.0.0">
  <artifact name="auth-kt" type="aar" />
</dependency>
@Grapes(
@Grab(group='com.webasyst', module='auth-kt', version='1.0.0')
)
libraryDependencies += "com.webasyst" % "auth-kt" % "1.0.0"
[com.webasyst/auth-kt "1.0.0"]

Зависимости

compile (1)

Идентификатор библиотеки Тип Версия
com.webasyst : auth jar 1.0.0

runtime (3)

Идентификатор библиотеки Тип Версия
org.jetbrains.kotlin : kotlin-stdlib jar 1.4.21
androidx.core » core-ktx jar 1.3.2
androidx.appcompat » appcompat jar 1.2.0

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

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

Webasyst-X-Android-Library

Creating new Webasyst Android client app

Starting from template

There is an example application using this library. Feel free to fork it and modify to your needs.

Starting from scratch

  1. Add dependencies

In your application module

repositories {
    // Make sure maven central repository is enabled
    mavenCentral()
    // ...
}

dependencies {
    // Library version to use
    def webasyst_version = '1.0.0'
    // Authentication module. Used in log in process.
    implementation "com.webasyst:auth-kt:$webasyst_version"
    // Webasyst ID (WAID) api client
    implementation "com.webasyst:waid:$webasyst_version"
    // Webasyst client - used to retrieve basic installation data
    implementation "com.webasyst:webasyst:$webasyst_version"
    // Required application-specific modules
    implementation "com.webasyst:app-blog:$webasyst_version"
        implementation "com.webasyst:app-shop:$webasyst_version"
        implementation "com.webasyst:app-site:$webasyst_version"
}
  1. In your app's AndroidManifest.xml, in application section, add authentication redirect activity. Note the comment on <data android:scheme= key
<activity android:name="net.openid.appauth.RedirectUriReceiverActivity">
  <intent-filter>
    <action android:name="android.intent.action.VIEW"/>
    <category android:name="android.intent.category.DEFAULT"/>
    <category android:name="android.intent.category.BROWSABLE"/>
    <!-- Authentication redirect scheme. It should be unique across the device. It's recommended to use app's package name. -->
    <data android:scheme="webasyst-x"/>
  </intent-filter>
</activity>
  1. Configure Webasyst ID (WAID) client. This should be done once, preferably early in application's lifecycle. The recommended option is to extend Application class and do configuration in it's onCreate() method. See WebasystAuthService.configure() for details.

  2. Implement Authentication Activity.

The easiest way to do it is to extend your Activity from WebasystAuthActivity and call it's waSignIn() from your SignIn button's onClick() callback.

If that's not an option (eg. your Activity is an extension of some other activity) you can use WebasystAuthHelper directly. See WebasystAuthActivity's code for details.

  1. You are good to go. Use WebasystAuthService's withFreshAccessToken() (or Kotlin extension) to perform api requests.
com.webasyst

1312 Inc.

Making amazing apps and digital products

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

Версия
1.0.0