This repository has been archived by the owner on Oct 11, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 56
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Change documentation to use LRBasicAuthentication
- Loading branch information
Bruno Farache
committed
Feb 5, 2015
1 parent
625ac98
commit 8427082
Showing
1 changed file
with
11 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -103,19 +103,25 @@ older versions, but these are the versions we use to run our unit tests. | |
1. Create a `Session` with the user credentials: | ||
|
||
```objective-c | ||
#import "LRBasicAuthentication.h" | ||
#import "LRSession.h" | ||
|
||
LRSession *session = [[LRSession alloc] initWithServer:@"http://localhost:8080" username:@"[email protected]" password:@"test"]; | ||
LRSession *session = [[LRSession alloc] initWithServer:@"http://localhost:8080" authentication:[[LRBasicAuthentication alloc] initWithUsername:@"[email protected]" password:@"test"]]; | ||
``` | ||
|
||
The first parameter is the URL of the Liferay instance you are connecting | ||
to. In this case, the emulator and Liferay are running in the same machine. | ||
|
||
The second parameter can be the user's email address, screen name, or | ||
user ID. It depends on which authentication method your Liferay instance is | ||
using. The default authentication method requires the user's email address. | ||
The second parameter is the user credentials for authentication. You need to | ||
provide the user's email address, screen name or user ID. It depends on which | ||
authentication method your Liferay instance is using. Along with that, you | ||
need to provide the user's password. | ||
|
||
The third parameter is the user's password. | ||
As the name indicates, `LRBasicAuthentication` uses Basic Authentication to | ||
authenticate each service call. The Mobile SDK also supports OAuth | ||
authentication as long as the OAuth Provider portlet is deployed to your Liferay | ||
Portal. To learn how to do OAuth authentication with the Mobile SDK, check the | ||
[OAuth sample app](https://github.com/brunofarache/liferay-ios-sdk-oauth). | ||
|
||
> Be careful to use these credentials on a production Liferay instance. If | ||
you're using the administrator credentials, you have permission to call any | ||
|