Thanks Eric.

- Tarun

On Wed, May 29, 2019 at 6:19 AM 'Eric Koleda' via Google Spreadsheets API <
google-spreadsheets-api@googlegroups.com> wrote:

> The link was broken, but it's been fixed now. Sorry for the trouble.
>
> - Eric
>
> On Tue, May 28, 2019 at 4:03 AM Tarun Sharma <tsharma.oc...@gmail.com>
> wrote:
>
>> Hi Eric,
>>
>> This might be too late but I am having the same problem the link doesn't
>> work (The group doesn't exists). Can you please redirect me to right link?
>>
>> On Friday, September 22, 2017 at 11:29:36 PM UTC+5:30, Eric Koleda wrote:
>>>
>>> Unfortunately we don't provide an auth library for iOS that supports
>>> service accounts. The issue has come up before, and here's an answer from
>>> one the engineers on the project:
>>>
>>>
>>> https://groups.google.com/forum/#!topic/google-api-objectivec-client/sroY7ZeGSCY
>>>
>>> Best,
>>> - Eric
>>>
>>> On Thursday, September 21, 2017 at 6:00:32 PM UTC-4, Fernando Embrioni
>>> wrote:
>>>>
>>>> Hi,
>>>>
>>>> We're developing an ios app (swift programming) that should write usage
>>>> data on a Google Spreadsheet. We don't want the user to sign-in for access
>>>> to the sheet, that's why we got a Service Account from Google. But at this
>>>> moment we're stuck trying to get a SecKey from the private key Google gave
>>>> us.
>>>>
>>>> Our first attempt was trying to find a library (and documentation) in
>>>> order to not reinvent the wheel, but we didn't find one or didn't
>>>> understand how to use it (We have been trying AppAuth but the usage
>>>> examples always ask for a user sign-in.
>>>>
>>>> So, we start to write code for HTTP/REST authorized api call (As it
>>>> stands in
>>>> https://developers.google.com/identity/protocols/OAuth2ServiceAccount
>>>> ), but for computing the signature we're getting an error when trying to
>>>> get a SecKey from the private key Google gave us.
>>>>
>>>> This is code from a Playground showing the problem:
>>>>
>>>>
>>>> let privateKey = "MIIEv....qgWKa+VH6w==" // privateKey has many more
>>>> characters (1649 characters in total)
>>>>
>>>> let privateKeyData = privateKey.data(using: String.Encoding.utf8)
>>>>
>>>> let base64privateKeyData = privateKeyData?.base64EncodedData()
>>>>
>>>>
>>>> // We tried different values of kSecAttrKeySizeInBits (256, 512, 1024,
>>>> 2048 and 4096) an none of them worked
>>>>
>>>> let keyDict:[NSObject:NSObject] = [
>>>>
>>>>     kSecAttrKeyType: kSecAttrKeyTypeRSA,
>>>>
>>>>     kSecAttrKeyClass: kSecAttrKeyClassPrivate,
>>>>
>>>>     kSecAttrKeySizeInBits: NSNumber(value: 4096),
>>>>
>>>>     kSecReturnPersistentRef: true as NSObject
>>>>
>>>> ]
>>>>
>>>>
>>>> let cfData = base64privateKeyData! as CFData
>>>>
>>>>
>>>> var error: Unmanaged<CFError>?
>>>>
>>>> let publicKey = SecKeyCreateWithData(cfData, keyDict as CFDictionary, &
>>>> error)
>>>>
>>>>
>>>> NSLog(error.debugDescription)
>>>>
>>>>
>>>>
>>>> The log output is as follows:
>>>>
>>>>
>>>> *2017-09-21 18:53:00.301 OAuthPlayground[32447:7458540]
>>>> Optional(Swift.Unmanaged<__ObjC.CFError>(_value: Error
>>>> Domain=NSOSStatusErrorDomain Code=-50 "RSA private key creation from data
>>>> failed" UserInfo={NSDescription=RSA private key creation from data
>>>> failed}))*
>>>>
>>>>
>>>>
>>>> Can anyone help us, please.
>>>>
>>>>
>>>> Thanks,
>>>>
>>>>
>>>> Fernando
>>>>
>>>>
>>>> --
>> You received this message because you are subscribed to a topic in the
>> Google Groups "Google Spreadsheets API" group.
>> To unsubscribe from this topic, visit
>> https://groups.google.com/d/topic/google-spreadsheets-api/1cVtts77HLY/unsubscribe
>> .
>> To unsubscribe from this group and all its topics, send an email to
>> google-spreadsheets-api+unsubscr...@googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/google-spreadsheets-api/1d3ef6a0-deaf-42e2-891a-d65db886afb6%40googlegroups.com
>> <https://groups.google.com/d/msgid/google-spreadsheets-api/1d3ef6a0-deaf-42e2-891a-d65db886afb6%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
> --
> You received this message because you are subscribed to the Google Groups
> "Google Spreadsheets API" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to google-spreadsheets-api+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/google-spreadsheets-api/CAC5MyANHmxg6qpaYyJsgmqaiO6jWtQPrkp0BH8jGzJRUY%2BUjTg%40mail.gmail.com
> <https://groups.google.com/d/msgid/google-spreadsheets-api/CAC5MyANHmxg6qpaYyJsgmqaiO6jWtQPrkp0BH8jGzJRUY%2BUjTg%40mail.gmail.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Google Spreadsheets API" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-spreadsheets-api+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-spreadsheets-api/CAF38tOsHV3Et8wLSs4atTgBt3AjrM%3D1PjrT-q4Po5R7EvZoqLw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to