Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions lib/src/authorization.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ library authorization;

import 'dart:async';
import 'package:http/http.dart' as http;
import 'package:formler/formler.dart';

import 'credentials.dart';
import 'client_credentials.dart';
Expand Down Expand Up @@ -41,7 +40,7 @@ class Authorization {
if (callbackURI == null) {
callbackURI = 'oob';
}
Map additionalParams = {
Map<String, String> additionalParams = {
'oauth_callback': callbackURI
};
var ahb = new AuthorizationHeaderBuilder();
Expand All @@ -57,7 +56,7 @@ class Authorization {
if ((res as http.Response).statusCode != 200) {
throw new StateError(res.body);
}
Map<String, String> params = Formler.parseUrlEncoded(res.body);
Map<String, String> params = Uri.splitQueryString(res.body);
if (params['oauth_callback_confirmed'].toLowerCase() != 'true') {
throw new StateError("oauth_callback_confirmed must be true");
}
Expand All @@ -78,7 +77,7 @@ class Authorization {
* http://tools.ietf.org/html/rfc5849#section-2.3
*/
Future<AuthorizationResponse> requestTokenCredentials(Credentials tokenCredentials, String verifier) {
Map additionalParams = {
Map<String, String> additionalParams = {
'oauth_verifier': verifier
};
var ahb = new AuthorizationHeaderBuilder();
Expand All @@ -95,7 +94,7 @@ class Authorization {
if ((res as http.Response).statusCode != 200) {
throw new StateError(res.body);
}
Map<String, String> params = Formler.parseUrlEncoded(res.body);
Map<String, String> params = Uri.splitQueryString(res.body);
return new AuthorizationResponse.fromMap(params);
});
}
Expand Down
5 changes: 2 additions & 3 deletions lib/src/client.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ library oauth1_client;

import 'dart:async';
import 'package:http/http.dart' as http;
import 'package:formler/formler.dart';

import 'signature_method.dart';
import 'client_credentials.dart';
Expand Down Expand Up @@ -41,12 +40,12 @@ class Client extends http.BaseClient {
var headers = request.headers;
Map<String, String> additionalParameters = new Map<String, String>();
if (headers.containsKey('Authorization')) {
additionalParameters = Formler.parseUrlEncoded(headers['Authorization']);
additionalParameters = Uri.splitQueryString(headers['Authorization']);
}
if (headers.containsKey('content-type') &&
headers['content-type'].contains('application/x-www-form-urlencoded') &&
(request as http.Request).body != null) {
additionalParameters.addAll(Formler.parseUrlEncoded((request as http.Request).body));
additionalParameters.addAll(Uri.splitQueryString((request as http.Request).body));
}
ahb.additionalParameters = additionalParameters;

Expand Down
1 change: 0 additions & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ version: 0.3.1
description: A pub package of OAuth 1.0 (RFC 5849) library.
dependencies:
crypto: any
formler: any
http: any
unittest: any
uuid: any