In Google Oauth2 VBA authentication I showed how to use this class. All associated libraries are available in the cDataSet.xlsm library downloadable here, or through gistthat, as described here. You’ll need the cRest module.

Examples

Here are some of the examples referred to in Google Oauth2 VBA authentication

Wrapper

A wrapper function is provided for access to the cOauth2 class. For now, only Google Oauth2 is implemented.

Public Function getGoogled(scope As String, _
                                Optional replacementpackage As cJobject = Nothing, _
                                Optional clientID As String = vbNullString, _
                                Optional clientSecret As String = vbNullString, _
                                Optional complain As Boolean = True, _
                                Optional cloneFromeScope As String = vbNullString) As cOauth2
    Dim o2 As cOauth2
    Set o2 = New cOauth2
    With o2.googleAuth(scope, replacementpackage, clientID, clientSecret, complain, cloneFromeScope)
        If Not .hasToken And complain Then
            MsgBox ("Failed to authorize to google for scope " & scope & ":denied code " & o2.denied)
        End If
    End With
    
    Set getGoogled = o2
End Function

cOauth2 class

Encryption

This uses the CAPICOM object for DES encryption, which is only supported in Excel 32bit. Excel 64 bit is not encrypted

For help and more information join our forum, follow the blog, follow me on Twitter