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
4 changes: 2 additions & 2 deletions dub.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
],
"targetType" : "library",
"dependencies" : {
"vibe-d:core" : "~>0.8.0-beta.6",
"vibe-d:core" : ">=0.8.0-beta.6 <0.10.0",
"vibe-d:data" : "*",
"vibe-d:http" : "*",
"vibe-d:web" : {
Expand All @@ -29,7 +29,7 @@
"postBuildCommands": ["rm ut.d"],
"mainSourceFile": "ut.d",
"dependencies": {
"unit-threaded": "~>0.7.11"
"unit-threaded": ">=0.7.11"
}
}
],
Expand Down
3 changes: 2 additions & 1 deletion source/oauth/provider/package.d
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,10 @@ class OAuthProvider
/// authorization redirect.
tokenRequestHttpGet = 0x02, /// use the GET http method when requesting
/// an access token.
clientAuthParams = 0x04 /// pass client credentials as parameters
clientAuthParams = 0x04, /// pass client credentials as parameters
/// rather than using http Basic
/// authentication.
tokenResponseType = 0x08, /// request access_token in authorization redirect.
}

/++
Expand Down
2 changes: 1 addition & 1 deletion source/oauth/session.d
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,7 @@ class OAuthSession
return default_;
}

struct SaveData
protected struct SaveData
{
SysTime timestamp;
Json tokenData;
Expand Down
6 changes: 3 additions & 3 deletions source/oauth/settings.d
Original file line number Diff line number Diff line change
Expand Up @@ -194,9 +194,9 @@ class OAuthSettings
foreach (k, v; extraParams)
reqParams[k] = v;

// Request an authorization code from the OAuth server. Subsequently,
// the authorization code may be exchanged for an access token.
reqParams["response_type"] = "code";
reqParams["response_type"] =
(provider.options & OAuthProvider.Option.tokenResponseType) ? "token" : "code";
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks like you're trying to use the OAuth2 implicit flow, which was excluded from this library because it is meant to be used by in-browser apps only, and D is not a language used to created such apps.

Please see the instructions for VK on https://vk.com/dev/authcode_flow_user

Copy link
Contributor Author

@denizzzka denizzzka Sep 27, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, I use it for auth of vk parsing tool logged as user. Tool generates URL, user clicks to it and then copy and pastes token response URL from browser into this tool.

This is official recommened way to authorize VK API user.


reqParams["client_id"] = clientId;

if (provider.options & OAuthProvider.Option.explicitRedirectUri)
Expand Down