welsinga / nonweb-sso-android

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

SURFnet Android SSO Library

Now you can easily integrate the SURFnet SSO process flow in your Android application by using this library.

Do you want to see it in action, check out the sample app in this repository.

HOW TO USE THE LIBRARY

Before you can use the library you need to have your consumerId registered by SURFnet and have received your consumer secret.

  1. Download the latest version of the library.
  2. Add the library to your project as lib.
  3. Declare the SSOServiceActivity class inside your AndroidManifest.xml:
<activity 
   android:name="nl.surfnet.nonweb.sso.SSOManager" 
   android:launchMode="singleTask">
   <intent-filter>
       <action android:name="android.intent.action.VIEW"/>
       
       <category android:name="android.intent.category.DEFAULT"/>
       <category android:name="android.intent.category.BROWSABLE"/>

       <data
           android:host="...."
           android:scheme="...."/>
   </intent-filter>
</activity>
  1. Add your consumer secret as host and your scheme information inside the data section.
  2. Inside your Activity call SSOServiceActivity.authorize with your consumerId, endpoint and scheme to start the authentication process.
SSOServiceActivity.authorize(v.getContext(), consumerId, endpoint, scheme, callback);
  1. You can optionally provide a SSOCallback to handle the authorize result
SSOCallback callback = new SSOCallback() {
 
 @Override
 public void success(Credential credential) {}
 
 @Override
 public void failure(String message) {}
};

Current version: 0.1.1

DEVELOPED BY

LICENSE

Copyright 2015 SURFnet BV, The Netherlands

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

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

About

License:Apache License 2.0


Languages

Language:Java 100.0%