oauth_for_android

程序名称:oauth_for_android

授权协议: 未知

操作系统: Android

开发语言: Java

oauth_for_android 介绍

这是一个为 Android 程序开发的 OAuth 库/应用,以便使用 Content Providers 来存储 OAuth 数据。

示例代码:

添加服务提供者

ContentValues values = new ContentValues(); 
values.put('request_token_url', 'http://mysite.com/request_token');
values.put('access_token_url', 'http://mysite.com/access_token');
values.put('authorize_url', 'http://mysite.com/authorize');
values.put('consumer_key', 'myconsumerkey');
values.put('consumer_secret', 'mysecret');

getContentResolver().insert(Uri.parse('content://com.novoda.oauth.providers/registry'), values)

重定向用户到OAuth 激活

Intent intent = new Intent();
Bundle extras = new Bundle();
HashMap<String, String> value = new HashMap<String, String>();

intent.setAction("com.novoda.oauth.action.OAUTH_CALL");
intent.setData(Uri.parse("content://com.novoda.oauth.provider.OAuth/registry"), ID_OF_THE_SERVICE));
extras.putString("endpoint", ENDPOINT_URI);
extras.putSerializable("parameters", value);
intent.putExtras(extras);

startActivityForResult(intent, RESULT_CALLBACK_ID);

oauth_for_android 官网

https://github.com/novoda/oauth_for_android

相关编程语言

BBGestureBack Full screen return gesture(全屏手...
Framework7 或者叫 F7 是全功能的绑定 iOS 7 应用的...
iOS 调试库,支持 iOS8+,无需添加任何代码,方便 i...
DarkModeKit是在Apple官方的深色模式发布之前设计和...
SimpleNote iOS 版客户端。SimpleNote 是一款在多平...
Kivy iOS,此工具旨在为 iOS 编译必要的库以运行应用...