demianbrecht / sanction

A dead simple OAuth2 client implementation.
MIT License
189 stars 43 forks source link

.p12 certificate support? #18

Open wsw70 opened 9 years ago

wsw70 commented 9 years ago

(this is a wishlist / enhancement "issue")

There is a possibility of a two-legged authentication in oAuth (information here and here).

In the case of Google, the method is part of the oAuth library:

# authenticate
        client_email = 'generatedbygoogleconsole@developer.gserviceaccount.com'
        with open('privatekeyalsogeneratedbygoogleconsole.p12', 'rb') as f:
            private_key = f.read()
        credentials = oauth2client.client.SignedJwtAssertionCredentials(
            client_email,
            private_key,
            'https://www.googleapis.com/auth/calendar.readonly',
            sub='user@example.com'
        )
        http_auth = credentials.authorize(httplib2.Http())
        service = apiclient.discovery.build('calendar', 'v3', http=http_auth)

Would there be a chance to have this service account oAuth authorization support in sanction?

demianbrecht commented 9 years ago

Hi @wsw70, thanks for the feature request. The best chance of having the support added is to submit a patch if you're able to :) Aside from that, I don't have much time these days for support here, but will definitely add it to my TODO list.