Skip to content

TeskaLabs/SeaCat-Android-G3

Repository files navigation

SeaCat SDK for Android

The 3rd generation of a SeaCat client for Android.

Installation from GitHub

The installation procedure has been inspired by this blog article. We assume that your Android project is managed by Git version control system.

  1. From Android Studio project terminal add git sub-module

     git submodule add https://github.com/TeskaLabs/SeaCat-Android-G3.git
    

    Android Studio: adding a git submodule

  2. Open Android Studio > File menu > Project Structure...

  3. Go to "Modules" and hit "+" (aka New Module)

    Android Studio: adding a submodule

  4. Select "Import Gradle Project"

  5. Select "Source directory", it is "SeaCat-Android-G3" folder in your project.

  6. Unselect "demo" checkbox.

    Android Studio: module import

  7. Press "Finish".

  8. Wait for Gradle to finish.

  9. Stay in "Project Structure" dialog, go to "Dependencies". select your application and "+" (aka Add Dependency)

    Android Studio: add dependency

  10. Select "Module Dependency"

  11. Select "seacat" and press "OK"

Android Studio: add dependency

  1. Press "OK" to close "Project Structure" dialog.
  2. The SeaCat client has been added to your project, please continue to a "Quick start" chapter.

Quick start

  1. SeaCat client needs to be initialized in your application class.

    Kotlin:

    ...
    import com.teskalabs.seacat.SeaCat
    ...
    
    class MyApplication : Application() {
    
    	...
    	lateinit var seacat: SeaCat
    	...
    
    	override fun onCreate() {
    		...
    		seacat = SeaCat(this, "https://pki.seacat.io/seacat-demo/seacat")
    		...
    	}
    }
    

    Remark: https://pki.seacat.io/seacat-demo/seacat is a public demo instance of the SeaCat PKI.

  2. Test

    Make URL request to SeaCat gateway at https://seacat-demo.seacat.io/hello

    • 200 means that all is good and the client is authenticated by SeaCat
    • 403 means that the authentication failed (the client is untrusted by a gateway)