oauth_for_android

码农软件 · 软件分类 · OAuth开发包 · 2019-04-19 11:41:33

软件介绍

这是一个为 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);

本文地址:https://codercto.com/soft/d/3915.html

Blog Design Solutions

Blog Design Solutions

Richard Rutter、Andy Budd、Simon Collison、Chris J Davis、Michael Heilemann、Phil Sherry、David Powers、John Oxton / friendsofED / 2006-2-16 / USD 39.99

Blogging has moved rapidly from being a craze to become a core feature of the Internetfrom individuals sharing their thoughts with the world via online diaries, through fans talking about their favori......一起来看看 《Blog Design Solutions》 这本书的介绍吧!

HTML 压缩/解压工具
HTML 压缩/解压工具

在线压缩/解压 HTML 代码

XML、JSON 在线转换
XML、JSON 在线转换

在线XML、JSON转换工具

RGB HSV 转换
RGB HSV 转换

RGB HSV 互转工具