Object
Implements the Flickr authentication API. Please see flickr.com/services/api/auth.spec.html for details on how to use this API in your application.
Don't instantiate this class yourself. Instead, create an instance of the Flickr class and then user Flickr.auth to access this class, like so:
require 'net/flickr'
flickr = Net::Flickr.new('524266cbd9d3c2xa2679fee8b337fip2',
'835hae5d6j0sd47a')
puts flickr.auth.url_desktop
Updates this Auth object with the credentials attached to the specified authentication token. If the token is not valid, an APIError will be raised.
# File lib/net/flickr/auth.rb, line 72 def check_token(token = @token) update_auth(@flickr.request('flickr.auth.checkToken', 'auth_token' => token)) return true end
Gets the full authentication token for the specified mini_token.
# File lib/net/flickr/auth.rb, line 79 def full_token(mini_token) update_auth(@flickr.request('flickr.auth.getFullToken', 'mini_token' => mini_token)) return @token end
Gets a frob to be used during authentication.
# File lib/net/flickr/auth.rb, line 86 def get_frob response = @flickr.request('flickr.auth.getFrob').at('frob') return @frob = response.inner_text end
Updates this Auth object with the credentials for the specified frob and returns an auth token. If the frob is not valid, an APIError will be raised.
# File lib/net/flickr/auth.rb, line 94 def get_token(frob = @frob) update_auth(@flickr.request('flickr.auth.getToken', 'frob' => frob)) return @token end
Gets a signed URL that can by used by a desktop application to show the user a Flickr authentication screen. Once the user has visited this URL and authorized your application, you can call get_token to authenticate.
# File lib/net/flickr/auth.rb, line 102 def url_desktop(perms) get_frob if @frob.nil? url = Flickr::AUTH_URL + "?api_key=#{@flickr.api_key}&perms=#{perms}&frob=#{@frob}" return @flickr.sign_url(url) end
Gets a signed URL that can be used by a web application to show the user a Flickr authentication screen. Once the user has visited this URL and authorized your application, you can call get_token with the frob provided by Flickr to authenticate.
# File lib/net/flickr/auth.rb, line 114 def url_webapp(perms) return @flickr.sign_url(Flickr::AUTH_URL + "?api_key=#{@flickr.api_key}&perms=#{perms}") end
Generated with the Darkfish Rdoc Generator 2.