Giter Club home page Giter Club logo

academy-oauth's Introduction

academy-oauth

##Preparation steps To build the library you need to install python 2.x.x, scons, gcc 4.8.0+.

##Building library Run 'scons' command in project directory to build release version of the library. If you need to build debug version, explicitly specify it with:

scons config=Debug

By default, the library includes PLAINTEXT and HMAC-SHA1 signatures. To build it with RSA-SHA1 you need to install openssl library. Then, you must pass --with-rsa flag to the build command, e.g.

scons config=Debug --with-rsa

If you want to configure build process with specific include and lib paths for openssl, you can use:

--openssl-libpath=<path>

and

--openssl-includepath=<path>

By default, the library does not include function to send requests over network. User will need to provide one. If you want to enable default cURL-based function, do the following:

  1. Run LoadcURLpp.py which is located in project root directory. It will download cURLpp files.
  2. Use --with-curl flag, e.g.
scons config=Debug --with-curl

If you want to configure build process with specific include and lib paths for cURL, you can use:

--curl-libpath=<path>

and

--curl-includepath=<path>

##Running tests Install openssl. Run LoadcURLpp.py which is located in project root directory. It will download cURLpp files.

Now you can build and run tests with

scons config=Test

academy-oauth's People

Contributors

swat32exe avatar antonraiev avatar 4d6178 avatar

Watchers

Denis Protivenskiy avatar Sasha Galiuzov avatar  avatar  avatar Kramarenko Andrew avatar evgeniy evstratov avatar  avatar  avatar

academy-oauth's Issues

Add default ctor for Token.

Forgot to say yesterday. For some reasons future<T> implementation by Microsoft requires default ctor. So for method:

std::future<Token> Service::getRequestToken();

I am getting such error now:

1>C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\future(307): error C2512: 'OAuth::Token' : no appropriate default constructor available
1>          C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\future(299) : while compiling class template member function 'std::_Associated_state<_Ty>::_Associated_state(std::_Deleter_base<_Ty> *)'
1>          with
1>          [
1>              _Ty=OAuth::Token
1>          ]
1>          C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\future(654) : see reference to function template instantiation 'std::_Associated_state<_Ty>::_Associated_state(std::_Deleter_base<_Ty> *)' being compiled
1>          with
1>          [
1>              _Ty=OAuth::Token
1>          ]
1>          C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\future(971) : see reference to class template instantiation 'std::_Associated_state<_Ty>' being compiled
1>          with
1>          [
1>              _Ty=OAuth::Token
1>          ]
1>          C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\future(969) : while compiling class template member function 'std::_State_manager<_Ty>::~_State_manager(void) throw()'
1>          with
1>          [
1>              _Ty=OAuth::Token
1>          ]
1>          C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\future(1132) : see reference to function template instantiation 'std::_State_manager<_Ty>::~_State_manager(void) throw()' being compiled
1>          with
1>          [
1>              _Ty=OAuth::Token
1>          ]
1>          C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\future(1107) : see reference to class template instantiation 'std::_State_manager<_Ty>' being compiled
1>          with
1>          [
1>              _Ty=OAuth::Token
1>          ]
1>          ..\..\academy-oauth\src\Service.cpp(44) : see reference to class template instantiation 'std::future<_Ty>' being compiled
1>          with
1>          [
1>              _Ty=OAuth::Token
1>          ]

Adding default ctor for Token class solves it.

Please, add default ctor, check by gcc compiler on buildable state on all platforms and run tests to be sure that everything is alright.

Use library without cURL and OpenSSL.

Guys, I have been starting to use our library for sample and found that we missed one good thing. I want to build our source code in Visual Studio 2012 without cURL and OpenSSL dependencies. So I excluded files for defaultSendRequest and RSA signature from build. And of course I got link errors, because we forgot to put defines in code for such stuff.

for example in Signature.cpp we should do:

#ifdef USE_RSA_SIGNATURE
#include "crypto/rsa/RsaSignature.h"
#endif

....

#ifdef USE_RSA_SIGNATURE
        case RSA_SHA1:
            return Signature("RSA-SHA1", rsaSha1Signature);
#endif

Please make similar define for defaultSendRequest in Service src and provide scons key --with-curl. In scons script you can make defines by key -D for gcc.

http://www.rapidtables.com/code/linux/gcc/gcc-d.htm

OAuth 2.0 implementation

Since OAuth 2.0 has many differences, we decided to implement it in a separate namespace OAuth2. We plan to create new Service, Token and Configuration classes for OAuth 2.0 and reuse old HttpRequest and ParameterList.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.