Authorise 2.62 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
/* Copyright 1997 Acorn Computers Ltd
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
/***************************************************/
/* File   : Authorise.h                            */
17
/*                                                 */
18
/* Purpose: Browser remote authorisation services. */
19 20
/*          (aka. authentication).                 */
/*                                                 */
21
/* Author : A.D.Hodgkinson                         */
22
/*                                                 */
23
/* History: 24-Apr-97: Created.                    */
24 25
/*          25-Aug-97: Definitions imported from   */
/*                     TBEvents.h.                 */
26 27
/***************************************************/

28 29 30 31 32 33 34 35 36 37 38 39 40 41
/* Authorise dialogue component IDs */

#define AuthPrompt                      0x01000
#define AuthUserWrit                    0x01001
#define AuthUserLabel                   0x01002
#define AuthPassWrit                    0x01003
#define AuthPassLabel                   0x01004
#define AuthCancel                      0x01005
#define AuthAuthorise                   0x01006

/* Authorise dialogue event codes */

#define EAuthCancel                     0x01005
#define EAuthAuthorise                  0x01006
42

43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61
/* Globals */

extern char * authorise;

/* Function prototypes */

_kernel_oserror * authorise_create_dialogue    (void * handle, ObjectId * id);
ObjectId          authorise_return_dialogue_id (void);
int               authorise_authorise          (int eventcode, ToolboxEvent * event, IdBlock * idb, void * handle);
int               authorise_cancel             (int eventcode, ToolboxEvent * event, IdBlock * idb, void * handle);

char            * authorise_read_realm         (char * header_entry);

int               authorise_find_offset        (char * host, char * realm);
int               authorise_find_user_name     (char * host, char * realm);
int               authorise_find_password      (char * host, char * realm);

_kernel_oserror * authorise_remember           (char * host, char * realm, char * username, char * password);
void              authorise_forget             (char * host, char * realm);