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.
Before you can use the library you need to have your consumerId
registered by SURFnet and have received your consumer secret
.
- Download the latest version of the library.
- Add the library to your project as lib.
- Declare the
SSOServiceActivity
class inside yourAndroidManifest.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>
- Add your
consumer secret
as host and yourscheme
information inside the data section. - Inside your Activity call
SSOServiceActivity.authorize
with yourconsumerId
,endpoint
andscheme
to start the authentication process.
SSOServiceActivity.authorize(v.getContext(), consumerId, endpoint, scheme, callback);
- 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
- SURFnet - https://www.surf.nl
- Egeniq - https://www.egeniq.com/
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.