This repository has been archived by the owner on Mar 9, 2022. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
BrowserID support for replicator (untested)
To use it with non persistent replications, set a TDBrowserIDAuthorizer. With persistent replications, add a "auth" sub-object of the "source" or "target" object (just as for OAuth) and in it put a "browserid" object with an "assertion" property whose value is the BrowserID assertion. This obviously requires that the remote server have BrowserID support. There is a CouchDB-BrowserID plugin, and IrisCouch's servers have it.
- Loading branch information
Showing
10 changed files
with
160 additions
and
22 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
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
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 |
---|---|---|
@@ -0,0 +1,17 @@ | ||
// | ||
// TDBrowserIDAuthorizer.h | ||
// TouchDB | ||
// | ||
// Created by Jens Alfke on 1/9/13. | ||
// | ||
// | ||
|
||
#import "TDAuthorizer.h" | ||
|
||
@interface TDBrowserIDAuthorizer: NSObject <TDAuthorizer> | ||
|
||
- (id) initWithAssertion: (NSString*)assertion; | ||
|
||
@property (readonly) NSString* assertion; | ||
|
||
@end |
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 |
---|---|---|
@@ -0,0 +1,47 @@ | ||
// | ||
// TDBrowserIDAuthorizer.m | ||
// TouchDB | ||
// | ||
// Created by Jens Alfke on 1/9/13. | ||
// | ||
// | ||
|
||
#import "TDBrowserIDAuthorizer.h" | ||
|
||
@implementation TDBrowserIDAuthorizer | ||
|
||
- (id) initWithAssertion:(NSString *)assertion { | ||
self = [super init]; | ||
if (self) { | ||
if (!_assertion) | ||
return nil; | ||
_assertion = [assertion copy]; | ||
} | ||
return self; | ||
} | ||
|
||
@synthesize assertion=_assertion; | ||
|
||
- (NSString*) authorizeURLRequest: (NSMutableURLRequest*)request | ||
forRealm: (NSString*)realm | ||
{ | ||
// Auth is via cookie, which is automatically added by CFNetwork. | ||
return nil; | ||
} | ||
|
||
- (NSString*) authorizeHTTPMessage: (CFHTTPMessageRef)message | ||
forRealm: (NSString*)realm | ||
{ | ||
// Auth is via cookie, which is automatically added by CFNetwork. | ||
return nil; | ||
} | ||
|
||
- (NSString*) loginPath { | ||
return @"/_browserid"; | ||
} | ||
|
||
- (NSDictionary*) loginParameters { | ||
return @{@"assertion": _assertion}; | ||
} | ||
|
||
@end |
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
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
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
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
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
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