Code Monkey home page Code Monkey logo

swisspasssdk-android's Introduction

SwissPassClient SDK for Android

Copyright Ā© Schweizerische Bundesbahnen SBB, 2016-2021.

Overview

The SwissPassClient SDK provides access to the SwissPass Login and SwissPassMobile.

SwissPass Login

The authentication of a user with the SwissPass login is based on the protocol OAuth 2.0 and the so-called Authorization Code Grant. This was implemented for use with native apps. The following points should be noted:

  • If an Access Token issued by the SwissPass Login is used to access further services resp. Data used, then this must be given to the corresponding requests as bearer tokens. See RFC 6750 at https://tools.ietf.org/html/rfc6750. In this case the app has to implement the error handling according to OAuth 2.0.
  • OAuth bearer tokens can be validated via token introspection on SwissPass IAM, see RFC 7662 at https://tools.ietf.org/html/rfc7662.
  • If an access token issued by the SwissPass login is renewed via SDK, then in some cases this operation may fail. In this case, either a RequestListener.SPC_ERROR_ACCESS_DENIED or a RequestListener.SPC_ERROR_INVALID_TOKEN is returned by the SDK and the app must re-login for the user.

SwissPassMobile

The SwissPassMobile is a virtualized SwissPass card. This can be displayed with the SDK by the SwissPassMobileFragment. Please note the following points: The SwissPassMobile can be activated by the user in up to 10 apps simultaneously. If there are more than 10 activations, already existing activations will be deleted automatically. In the event of a logout, the existing activation on the SwissPass will not be deactivated. The following login checks whether the same user logs in again, if this is not the case the existing SwissPassMobile will be deactivated.

Requirements

Android min API Level 23.

Further information

All error messages and their descriptions are in RequestListener.java

swisspasssdk-android's People

Contributors

grodien avatar mosberger avatar probert73 avatar

Stargazers

Jonas Heubuch avatar Timo Tomasini avatar

Watchers

 avatar James Cloos avatar  avatar  avatar Florian Brunner avatar  avatar Marius avatar  avatar Shansai Muraleetharan avatar

Forkers

samuelba

swisspasssdk-android's Issues

Link Card Swisspass page feature doesn't bring back to application

Hello,

Iā€™m implementing the SwissPass link card management process using your SDK: swissPassLoginClient.openSwissPass(Page.LINK_CARD_MANAGEMENT
which is a redirection to a web page. When using it, I get this:
image

When I click on Link Now, I guess the process should be done on SBB side and I should get the result of it. Unfortunately, it seems nothing happens.
I tried your demoApp and got the same result.
Am I missing something?

Thank you for your help!

Improvement: Request to Extend CustomTabActivity from ComponentActivity Instead of Activity

We are currently using your SDK and have encountered an issue that I believe can be resolved with a minor modification to the CustomTabUtilActivity class.

I have an overlay popping on all activities that uses Jetpack Compose and requires the viewTreeLifecycle. Currently, CustomTabUtilActivity extends Activity, which does not provide the necessary lifecycle methods required for my Compose overlay.

To address this issue, I kindly request that CustomTabUtilActivity be modified to extend ComponentActivity instead of Activity. The ComponentActivity class includes the required lifecycle methods that will allow my Compose overlay to function correctly.

I believe extending ComponentActivity instead of Activity would be harmless to the existing functionality of the SDK and also this change would not require any backtesting as it would bear no impact on the current implementation.

Thank you for considering this request and I appreciate your attention to this matter.

The SDK is not compatible with app targetting Android 12

Targeting S+ (version 10000 and above) requires that one of FLAG_IMMUTABLE or FLAG_MUTABLE be specified when creating a PendingIntent

https://stackoverflow.com/questions/68228666/targeting-s-version-10000-and-above-requires-that-one-of-flag-immutable-or-fl

WorkManager Version 2.6.0 is not compatible for apps targeting Android 12 (S). You should be using version 2.7.0 instead. Source: https://developer.android.com/jetpack/androidx/releases/work#version_260_3

Apparently you still use version 2.5.0

CleanShot 2021-11-05 at 20 58 55

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    šŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. šŸ“ŠšŸ“ˆšŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ā¤ļø Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.