Giter Site home page Giter Site logo

Comments (15)

danielctull avatar danielctull commented on September 27, 2024

I've not seen this myself. What version of Xcode are you using?

from dctauth.

RobKaldor avatar RobKaldor commented on September 27, 2024

Morning,
I'm running 10.8.2 with Xcode 4.5.2, up to date but not beta.
It may be just that I'm not including the library correctly.
Do I just add the DCTAuth folder to my project? I'm a little hazy on the correct method perhaps?

Rob

from dctauth.

danielctull avatar danielctull commented on September 27, 2024

Hi Rob,

I think that should work, but it's not advisable. The best way to include it is as a subproject as such:

  1. Drag the DCTAuth Xcode project into your file list in your application project
  2. Go to your app Xcode project in the files and go to the build phases tab for your app target
  3. Add DCTAuth to the "Link Binary with Libraries" section (by clicking the + button)
  4. You also need to add the following system libraries: Security.framework, libresolv.dylib

Details of a lot of this can be found here: http://www.blog.montgomerie.net/easy-xcode-static-library-subprojects-and-submodules

Hope this helps,
Daniel

from dctauth.

RobKaldor avatar RobKaldor commented on September 27, 2024

Awesome, thanks, will try and let you know.

from dctauth.

RobKaldor avatar RobKaldor commented on September 27, 2024

OK, followed the instructions on the link, exceelent btw. Project is included.
When I call
[oauthAccount authenticateWithHandler:^(NSDictionary *responses, NSError *error) { }];

I get the following:
2013-01-18 09:48:51.412 Spearmint[33659:c07] -[NSURL dctAuth_URLByAddingQueryParameters:]: unrecognized selector sent to instance 0xae7ce30
2013-01-18 09:48:51.425 Spearmint[33659:c07] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[NSURL dctAuth_URLByAddingQueryParameters:]: unrecognized selector sent to instance 0xae7ce30'
*** First throw call stack:
(0x2522012 0x17a1e7e 0x25ad4bd 0x2511bbc 0x251194e 0x15982 0x1582a 0x162cf 0x16442 0x1bc91 0x1b248 0x89ff 0x17b5705 0x240920 0x2408b8 0x301671 0x301bcf 0x300d38 0x27033f 0x270552 0x24e3aa 0x23fcf8 0x2f57df9 0x2f57ad0 0x2497bf5 0x2497962 0x24c8bb6 0x24c7f44 0x24c7e1b 0x2f567e3 0x2f56668 0x23d65c 0x25ed 0x2525)
libc++abi.dylib: terminate called throwing an exception

Any thoughts?

from dctauth.

danielctull avatar danielctull commented on September 27, 2024

Ah yeah, you'll need to add -ObjC to the Other Linker Flags in the build settings of your project. This will bring in the categories I've added in DCTAuth. :)

Screen Shot 2013-01-18 at 10 00 45

from dctauth.

RobKaldor avatar RobKaldor commented on September 27, 2024

Yep that fixed it, top man.
OK, off to play with OAuth...

from dctauth.

danielctull avatar danielctull commented on September 27, 2024

Have fun!

What service are you accessing by the way?

from dctauth.

RobKaldor avatar RobKaldor commented on September 27, 2024

It's under NDA, an internal system for a client.
Question: It's popping out to the browser for the sign in, but it's not returning to the app once auth'd. I can;t see anything different to the demo app in my code. Am I missing setting a callback somewhere?

from dctauth.

danielctull avatar danielctull commented on September 27, 2024

OK, cool! :)

You need to set the callbackURL on the account and this should match your URL scheme for the app that you can see in the plist.

from dctauth.

danielctull avatar danielctull commented on September 27, 2024

It might also be worth noting that you can use +[DCTAuth setURLOpener:] to handle URLs that get pushed to Safari (so if you want to use an internal UIWebView to handle it). If you do this, you still need to set the callbackURL and call to handle it with +[DCTAuth handleURL:].

from dctauth.

RobKaldor avatar RobKaldor commented on September 27, 2024

Awesome, works.
If you don't mind a further question...
The service I'm connecting to requires a signature, signature method and nonce.
Does this get generated for me by the DCAuthRequest or do I have to assemble it from the data I get back from the auth connection? I'm a bit newby on this...
Edit: From looking at the source the signature is generated from the URL given to the account. If I'm sending a request to a slightly different URL, do I need a different account generated?

from dctauth.

danielctull avatar danielctull commented on September 27, 2024

If you assign an authorised account to a request, then when you perform the request or get a signedRequest, it should have the correct authentication headers.

from dctauth.

RobKaldor avatar RobKaldor commented on September 27, 2024

Hmmm. Thats What I thought. Could I send a bit of code via email and get your opinion?

from dctauth.

danielctull avatar danielctull commented on September 27, 2024

Sure thing, my email is listed on my profile page: https://github.com/danielctull :)

from dctauth.

Related Issues (6)

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.