Class: Sharepoint::Session

Inherits:
Object
  • Object
show all
Defined in:
lib/sharepoint-session.rb

Defined Under Namespace

Classes: AuthenticationFailed, ConnexionToSharepointFailed, ConnexionToStsFailed, Error, UnknownAuthenticationError

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(site) ⇒ Session

Returns a new instance of Session.



39
40
41
# File 'lib/sharepoint-session.rb', line 39

def initialize site
  @site = site
end

Instance Attribute Details

#siteObject

Returns the value of attribute site.



37
38
39
# File 'lib/sharepoint-session.rb', line 37

def site
  @site
end

Instance Method Details

#authenticate(user, password, sts_url = nil) ⇒ Object



43
44
45
46
47
# File 'lib/sharepoint-session.rb', line 43

def authenticate user, password, sts_url = nil
  sts_url ||= MICROSOFT_STS_URL
  authenticate_to_sts user, password, sts_url
  get_access_token
end


49
50
51
# File 'lib/sharepoint-session.rb', line 49

def cookie
  "FedAuth=#{@fed_auth};rtFa=#{@rtFa}"
end