IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

Web & réseau Delphi Discussion :

Implementation OAuth2 côté serveur


Sujet :

Web & réseau Delphi

  1. #1
    Membre éclairé
    Avatar de Higgins
    Inscrit en
    Juillet 2002
    Messages
    539
    Détails du profil
    Informations forums :
    Inscription : Juillet 2002
    Messages : 539
    Par défaut Implementation OAuth2 côté serveur
    Bonjour à toutes et à tous,

    J'ai développé un serveur Datasnap (TDSServer) qui utilise une authentification basique par nom d'utilisateur/Mot de passe.

    Mes applications clientes se connectent en passant "Authorization: 'Basic user:password" dans le header.

    En vue d'une mise en production, je voudrais renforcer la sécurité en passant à l'utilisation de jetons.

    J'ai déjà codé plusieurs applications clientes qui utilisent des "bearer" pour des API grand public et je voudrais implémenter la même chose pour mon serveur
    J'ai trouvé beaucoup de littérature pour le côté client mais pas grand chose pour le côté serveur. Est-ce que quelqu'un aurait des liens vers des articles ou tuto?

  2. #2
    Expert éminent
    Avatar de ShaiLeTroll
    Homme Profil pro
    Développeur C++\Delphi
    Inscrit en
    Juillet 2006
    Messages
    14 086
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 44
    Localisation : France, Seine Saint Denis (Île de France)

    Informations professionnelles :
    Activité : Développeur C++\Delphi
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Juillet 2006
    Messages : 14 086
    Par défaut
    Tu voudrais créer ta propre autorité (génération du Token, Vérification du Token) ou tu utiliserais par exemple Azure pour déclarer ton API et utiliser Azure comme autorité ?
    Faudra prévoir un écran de constement via un WebBrowser pour Azure
    Pour ta propre autorité, tu peux utiliser une négociation HMAC pour créer une "demande de jeton" chaque utilisateur a un clé privée (certificat) et l'autorité a les clés public correspondantes
    A partir de la "demande de jeton" pour générer le JWT, l'autorité à sa clé privée et une clé publique pour le vérifier

    Evidement le stockage des clés privées c'est l'enjeu majeur de cette approche du Self-signing tokens
    Microsoft propose aussi des mécanimes de Self-signing tokens lorsque l'on ajoute sa propre API à Azure

    J'ai pas bossé sur DataSnap depuis XE2, si c'est encore basé sur Indy, tu peux modifier directement le code de Indy, en XE2 même un client bearer c'était déjà pas prévu alors un serveur encore moins.
    Le Indy de D10 lui non plus ne gère pas autre chose que du Authorization Basic pour SMTP, POP, IMAP4, j'ai du le coder manuellement, il semble qu'à ce sujet, Delphi soit sacrément en retard.

    EDIT : très intéressant : How do I implement "Authorization: Bearer <Token>" in a Delphi REST Server? cela n'a que six mois, donc faut toujours tout faire à la main
    Aide via F1 - FAQ - Guide du développeur Delphi devant un problème - Pensez-y !
    Attention Troll Méchant !
    "Quand un homme a faim, mieux vaut lui apprendre à pêcher que de lui donner un poisson" Confucius
    Mieux vaut se taire et paraître idiot, Que l'ouvrir et de le confirmer !
    L'ignorance n'excuse pas la médiocrité !

    L'expérience, c'est le nom que chacun donne à ses erreurs. (Oscar Wilde)
    Il faut avoir le courage de se tromper et d'apprendre de ses erreurs

  3. #3
    Membre éclairé
    Avatar de Higgins
    Inscrit en
    Juillet 2002
    Messages
    539
    Détails du profil
    Informations forums :
    Inscription : Juillet 2002
    Messages : 539
    Par défaut
    Merci pour le lien, il est très intéressant. Je vais regarder les différents liens donnés dans l'article

    Ce ne sera pas une API publique, elle sera réservée à un pool d'applications. Elle ne devrait être déployée que sur des intranets, qui plus est rarement relié à l'internet "extérieur".
    L'idée serait donc plutôt de générer mes propres jetons, avec idéalement une durée de validité limitée et un renouvellement automatique

  4. #4
    Expert éminent
    Avatar de ShaiLeTroll
    Homme Profil pro
    Développeur C++\Delphi
    Inscrit en
    Juillet 2006
    Messages
    14 086
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 44
    Localisation : France, Seine Saint Denis (Île de France)

    Informations professionnelles :
    Activité : Développeur C++\Delphi
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Juillet 2006
    Messages : 14 086
    Par défaut
    le Jeton inclu la date d'expiration, c'est le champ (claim) exp (Expiration Time) ou tu peux la recalculer à partir de iat (Issued At)
    Tu peux faire confiance à ce champ puisque la signature garanti que le jeton n'est pas modifié

    Je me suis amusé à en générer par curiosité, d'ailleurs, la fin c'est pour un système de PAT (le serveur connait les PAT autorisés, contrairement au JWT qui sont volatiles)

    La Clé peut être lu d'un fichier PEM - voir ce code : TSLTPEMKeyLoader qui utilise Indy Open SSL (implique un DLL)

    Nom : Sans titre.png
Affichages : 102
Taille : 42,6 Ko

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
    128
    129
    130
    131
    132
    133
    134
    135
    136
    137
    138
    139
    140
    141
    142
    143
    144
    145
    146
    147
    148
    149
    150
    151
    152
    153
    154
    155
    156
    157
    158
    159
    160
    161
    162
    163
    164
    165
    166
    167
    168
    169
    170
    171
    172
    173
    174
    175
    176
    177
    178
    179
    180
    181
    182
    183
    184
    185
    186
    187
    188
    189
    190
    191
    192
    193
    194
    195
    196
    197
    198
    199
    200
    201
    202
    203
    204
    205
    206
    207
    208
    209
    210
    211
    212
    213
    214
    215
    216
    217
    218
    219
    220
    221
    222
    223
    224
    225
    226
    227
    228
    229
    230
    231
    232
    233
    234
    235
    236
    237
    238
    239
    240
    241
    242
    243
    244
    245
    246
    247
    248
    249
    250
    251
    252
    253
    254
    255
    256
    257
    258
    259
    260
    261
    262
    263
    264
    265
    266
    267
    268
    269
    270
    271
    272
    273
    274
    275
    276
    277
    278
    279
    280
    281
    282
    283
    284
    285
    286
    287
    288
    289
    290
    291
    292
    293
    294
    295
    296
    297
    298
    299
    300
    301
    302
    303
    304
    305
    306
    307
    308
    309
    310
    311
    312
    313
    314
    315
    316
    317
    318
    319
    320
    321
    322
    323
    324
    325
    326
    327
    328
    329
    330
    331
    332
    333
    334
    335
    336
    337
    338
    339
    340
    341
    342
    343
    344
    345
    346
    347
    348
    349
    350
    351
    352
    353
    354
    355
    356
    357
    358
    359
    360
    361
    362
    363
     
    unit SLTJWT;
     
    interface
     
    uses
      System.SysUtils, System.Types, System.Hash;
     
    type
      TSLTJWT = class;
      TSLTJWTClaimsStandard = class;
     
      ESLTJWTError = class(Exception);
     
      TSLTJWTAlgorithm = (jwaUnknown, jwaNone, jwaHS256, jwaHS384, jwaHS512);
      TSLTJWTTokenType = (jttUnknown, jttJWT);
     
      TSLTJWTDigestType = THashSHA2.TSHA2Version;
     
      TSLTJWT = class(TObject)
      private
        FHeaderAlgorithm: TSLTJWTAlgorithm;
        FHeaderTokenType: TSLTJWTTokenType;
        FClaimsStandard: TSLTJWTClaimsStandard;
     
        function ToJSONString(): string;
      public
        constructor Create();
        destructor Destroy; override;
     
        function BuildJSONStrings(out AHeader, APayload: string): Boolean;
        function EncodeJSONStrings(const AHeader, APayload: string; out AEncodedPart: string): Boolean;
        function SignJSONEncodedPart(const AEncodedPart: string; const AKey: string; AKeyBase64Encoded: Boolean; out AToken: string): Boolean;
        function DigestSignJSON(const AToken: string; ADigestType: TSLTJWTDigestType; ABase64URLEncoded: Boolean; out ADigest: string; var ASalt: string): Boolean;
     
        property HeaderAlgorithm: TSLTJWTAlgorithm read FHeaderAlgorithm write FHeaderAlgorithm;
        property HeaderTokenType: TSLTJWTTokenType read FHeaderTokenType write FHeaderTokenType;
        property ClaimsStandard: TSLTJWTClaimsStandard read FClaimsStandard;
      public
        class function GetSupportedAlgorithms(): TStringDynArray;
        class function GetSupportedTokenTypes(): TStringDynArray;
     
        class function GetDefaultAlgorithm(): string;
        class function GetDefaultTokenType(): string;
     
        class function GetAlgorithm(const ACode: string): TSLTJWTAlgorithm;
        class function GetTokenType(const ACode: string): TSLTJWTTokenType;
      end;
     
      TSLTJWTClaimsStandard = class(TObject)
      private
        FIssuer: string;
        FSubject: string;
        FAudience: string;
        FExpirationTime: TDateTime;
        FNotBefore: TDateTime;
        FIssuedAt: TDateTime;
        FJWTID: string;
      public
        function ToJSONString(): string;
     
        property Issuer: string read FIssuer write FIssuer;
        property Subject: string read FSubject write FSubject;
        property Audience: string read FAudience write FAudience;
        property ExpirationTime: TDateTime read FExpirationTime write FExpirationTime;
        property NotBefore: TDateTime read FNotBefore write FNotBefore;
        property IssuedAt: TDateTime read FIssuedAt write FIssuedAt;
        property JWTID: string read FJWTID write FJWTID;
      end;
     
    implementation
     
    uses System.TypInfo, System.JSON, System.StrUtils, System.DateUtils, System.NetEncoding;
     
    const
      SLT_JWT_ALGORITHMS: array[TSLTJWTAlgorithm] of string = ('', 'None', 'HS256', 'HS384', 'HS512');
      SLT_JWT_TOKEN_TYPES: array[TSLTJWTTokenType] of string = ('', 'JWT');
     
    { TSLTJWT }
     
    // https://docwiki.embarcadero.com/RADStudio/Alexandria/en/What%27s_New : New TBase64URLEncoding encoding and TNetEncoding.Base64URL property
    const
      CompilerVersionAlexandria = 35.0;
      CompilerVersionSeattle = 30.0;
     
    {$IF CompilerVersion < CompilerVersionAlexandria}
    type
      TBase64URLEncoding = class(TBase64Encoding)
      protected
        function DoDecode(const Input: string): string; override;
        function DoEncode(const Input: string): string; override;
     
        function DoEncodeBytesToString(const Input: array of Byte): string; overload; override;
      end;
    {$IFEND}
     
    //------------------------------------------------------------------------------
    constructor TSLTJWT.Create();
    begin
      inherited Create();
     
      FClaimsStandard := TSLTJWTClaimsStandard.Create();
    end;
     
    //------------------------------------------------------------------------------
    destructor TSLTJWT.Destroy();
    begin
      FreeAndNil(FClaimsStandard);
     
      inherited Destroy();
    end;
     
    //------------------------------------------------------------------------------
    function TSLTJWT.BuildJSONStrings(out AHeader, APayload: string): Boolean;
    begin
      AHeader := ToJSONString();
      APayload := FClaimsStandard.ToJSONString();
      Result := True;
    end;
     
    //------------------------------------------------------------------------------
    function TSLTJWT.EncodeJSONStrings(const AHeader, APayload: string; out AEncodedPart: string): Boolean;
    begin
      with TBase64URLEncoding.Create(0) do
      try
        AEncodedPart := Encode(AHeader) + '.' + Encode(APayload);
      finally
        Free();
      end;
      Result := True;
    end;
     
    //------------------------------------------------------------------------------
    function TSLTJWT.SignJSONEncodedPart(const AEncodedPart: string; const AKey: string; AKeyBase64Encoded: Boolean; out AToken: string): Boolean;
    type
      TMapEntry = record
        JWTAlgorithm: TSLTJWTAlgorithm;
        SHA2Version: THashSHA2.TSHA2Version;
      end;
    const
      SHA_TABLES: array[1..3] of TMapEntry =
        (
          (JWTAlgorithm: jwaHS256; SHA2Version: SHA256;),
          (JWTAlgorithm: jwaHS384; SHA2Version: SHA384;),
          (JWTAlgorithm: jwaHS512; SHA2Version: SHA512;)
        );
     
      function GetSHA2Version(): THashSHA2.TSHA2Version;
      var
        it: TMapEntry;
      begin
        for it in SHA_TABLES do
          if it.JWTAlgorithm = FHeaderAlgorithm then
            Exit(it.SHA2Version);
     
        raise ESLTJWTError.Create('Invalid Algorithm for Sign');
      end;
     
    var
      B: TBytes;
    begin
      if AKeyBase64Encoded then
        B := System.Hash.THashSHA2.GetHMACAsBytes(AEncodedPart, TNetEncoding.Base64.Decode(AKey), GetSHA2Version())
      else
        B := System.Hash.THashSHA2.GetHMACAsBytes(AEncodedPart, AKey, GetSHA2Version());
     
      with TBase64URLEncoding.Create(0) do
      try
        AToken := AEncodedPart + '.' + EncodeBytesToString(B);
      finally
        Free();
      end;
     
      Result := True;
    end;
     
    //------------------------------------------------------------------------------
    function TSLTJWT.DigestSignJSON(const AToken: string; ADigestType: TSLTJWTDigestType; ABase64URLEncoded: Boolean; out ADigest: string; var ASalt: string): Boolean;
     
      function GetSALT(): string;
      var
        B: TBytes;
      begin
        // 16 Bytes x 2 cela donne un 32 Bytes
        B := TGUID.NewGuid().ToByteArray() + TGUID.NewGuid().ToByteArray();
        // Encodage en Base64 augmente le volume de 32 à 43 Bytes (3 bytes deviennt 4 caractères)
        with TBase64URLEncoding.Create(0) do
        try
          Result := Copy(EncodeBytesToString(B), 1, 32);
        finally
          Free();
        end;
      end;
     
    begin
      if ASalt = '' then
        ASalt := GetSALT();
     
      if ABase64URLEncoded then
      begin
        with TBase64URLEncoding.Create(0) do
        try
          ADigest := EncodeBytesToString(System.Hash.THashSHA2.GetHashBytes(ASalt + AToken, ADigestType));
        finally
          Free();
        end;
      end
      else
        ADigest := System.Hash.THashSHA2.GetHashString(ASalt + AToken, ADigestType);
     
      Result := True;
    end;
     
    //------------------------------------------------------------------------------
    function TSLTJWT.ToJSONString(): string;
    begin
      if FHeaderAlgorithm = jwaUnknown then
        raise ESLTJWTError.Create('Unknown Algorithm');
      if FHeaderTokenType = jttUnknown then
        raise ESLTJWTError.Create('Unknown Token Type');
     
      with TJSONObject.Create() do
      try
        AddPair(TJSONPair.Create('alg', TJSONString.Create(SLT_JWT_ALGORITHMS[FHeaderAlgorithm])));
        AddPair(TJSONPair.Create('typ', TJSONString.Create(SLT_JWT_TOKEN_TYPES[FHeaderTokenType])));
     
        Result := ToJSON();
      finally
        Free();
      end;
    end;
     
    //------------------------------------------------------------------------------
    class function TSLTJWT.GetDefaultAlgorithm(): string;
    begin
      Result := SLT_JWT_ALGORITHMS[jwaHS512];
    end;
     
    //------------------------------------------------------------------------------
    class function TSLTJWT.GetDefaultTokenType(): string;
    begin
      Result := SLT_JWT_TOKEN_TYPES[jttJWT];
    end;
     
    //------------------------------------------------------------------------------
    class function TSLTJWT.GetSupportedAlgorithms(): TStringDynArray;
    var
      I: TSLTJWTAlgorithm;
      L: Integer;
    begin
      I := Succ(Low(SLT_JWT_ALGORITHMS));
      L := Ord(High(SLT_JWT_ALGORITHMS)) - Ord(I) + 1;
      SetLength(Result, L);
      CopyArray(@Result[0], @SLT_JWT_ALGORITHMS[I], TypeInfo(string), L);
    end;
     
    //------------------------------------------------------------------------------
    class function TSLTJWT.GetSupportedTokenTypes(): TStringDynArray;
    var
      I: TSLTJWTTokenType;
      L: Integer;
    begin
      I := Succ(Low(SLT_JWT_TOKEN_TYPES));
      L := Ord(High(SLT_JWT_TOKEN_TYPES)) - Ord(I) + 1;
      SetLength(Result, L);
      CopyArray(@Result[0], @SLT_JWT_TOKEN_TYPES[I], TypeInfo(string), L);
    end;
     
    //------------------------------------------------------------------------------
    class function TSLTJWT.GetAlgorithm(const ACode: string): TSLTJWTAlgorithm;
    var
      I: Integer;
    begin
      if ACode <> '' then
      begin
        I := IndexStr(ACode, SLT_JWT_ALGORITHMS);
        if (Ord(Low(TSLTJWTAlgorithm)) < I) and (I <= Ord(High(TSLTJWTAlgorithm))) then
          Result := TSLTJWTAlgorithm(I)
        else
          raise ESLTJWTError.CreateFmt('Invalid Algorithm (%s)', [ACode]);
      end
      else
        raise ESLTJWTError.Create('Empty Algorithm');
    end;
     
    //------------------------------------------------------------------------------
    class function TSLTJWT.GetTokenType(const ACode: string): TSLTJWTTokenType;
    var
      I: Integer;
    begin
      if ACode <> '' then
      begin
        I := IndexStr(ACode, SLT_JWT_TOKEN_TYPES);
        if (Ord(Low(TSLTJWTTokenType)) <  I) and (I <= Ord(High(TSLTJWTTokenType))) then
          Result := TSLTJWTTokenType(I)
        else
          raise ESLTJWTError.CreateFmt('Invalid Token Type (%s)', [ACode]);
      end
      else
        raise ESLTJWTError.Create('Empty Token Type');
    end;
     
    { TSLTJWTClaimsStandard }
     
    //------------------------------------------------------------------------------
    function TSLTJWTClaimsStandard.ToJSONString(): string;
    begin
      with TJSONObject.Create() do
      try
        if FIssuer <> '' then
          AddPair(TJSONPair.Create('iss', TJSONString.Create(FIssuer)));
        if FSubject <> '' then
          AddPair(TJSONPair.Create('sub', TJSONString.Create(FSubject)));
        if FAudience <> '' then
          AddPair(TJSONPair.Create('aud', TJSONString.Create(FAudience)));
        if FExpirationTime > 0 then
          AddPair(TJSONPair.Create('exp', TJSONNumber.Create(DateTimeToUnix(FExpirationTime, False))));
        if FNotBefore > 0 then
          AddPair(TJSONPair.Create('nbf', TJSONNumber.Create(DateTimeToUnix(FNotBefore, False))));
        if FIssuedAt > 0 then
          AddPair(TJSONPair.Create('iat', TJSONNumber.Create(DateTimeToUnix(FIssuedAt, False))));
        if FJWTID <> '' then
          AddPair(TJSONPair.Create('jti', TJSONString.Create(FJWTID)));
     
        Result := ToJSON();
      finally
        Free();
      end;
    end;
     
    { TBase64URLEncoding }
     
    {$IF CompilerVersion < CompilerVersionAlexandria}
    //------------------------------------------------------------------------------
    function TBase64URLEncoding.DoDecode(const Input: string): string;
    begin
      Result := Input + StringOfChar('=', (4 - Length(Input) mod 4) mod 4);
      Result := StringReplace(Result, '-', '+', [rfReplaceAll]);
      Result := StringReplace(Result, '_', '/', [rfReplaceAll]);
      Result := inherited DoEncode(Result);
    end;
     
    //------------------------------------------------------------------------------
    function TBase64URLEncoding.DoEncode(const Input: string): string;
    begin
      Result := inherited DoEncode(Input);
      Result := StringReplace(Result, '+', '-', [rfReplaceAll]);
      Result := StringReplace(Result, '/', '_', [rfReplaceAll]);
      Result := StringReplace(Result, '=', '', [rfReplaceAll]);
    end;
     
    //------------------------------------------------------------------------------
    function TBase64URLEncoding.DoEncodeBytesToString(const Input: array of Byte): string;
    begin
      Result := inherited DoEncodeBytesToString(Input);
      Result := StringReplace(Result, '+', '-', [rfReplaceAll]);
      Result := StringReplace(Result, '/', '_', [rfReplaceAll]);
      Result := StringReplace(Result, '=', '', [rfReplaceAll]);
    end;
     
    {$IFEND}
     
    end.

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    procedure TSLTJWTTokenBuilderForm.btnBuildClick(Sender: TObject);
     
      function Crypt(const S: string; DoCrypt: Boolean): string; inline;
      begin
        if DoCrypt then
          Result := FCrypter.Crypt(S)
        else
          Result := S;
      end;
     
    var
      JSONHeader, JSONPayload: string;
      EncodedPart, Token, Digest, Salt: string;
    begin
      with TSLTJWT.Create() do
      try
        HeaderAlgorithm := TSLTJWT.GetAlgorithm(cbxHeaderAlgorithm.Items[cbxHeaderAlgorithm.ItemIndex]);
        HeaderTokenType := TSLTJWT.GetTokenType(cbxHeaderType.Items[cbxHeaderType.ItemIndex]);
        ClaimsStandard.Issuer := edIssuer.Text;
        if not ckbPayloadMinimal.Checked then
        begin
          ClaimsStandard.Subject := edSubject.Text;
          ClaimsStandard.Audience := Crypt(edAudience.Text, ckbAudienceCrypted.Checked);
          if ckbExpirationTime.Checked then
            ClaimsStandard.ExpirationTime := DateOf(edExpirationDate.DateTime) + TimeOf(edExpirationTime.DateTime)
          else
            ClaimsStandard.ExpirationTime := 0;
          ClaimsStandard.IssuedAt := DateOf(edCreationDate.DateTime) + TimeOf(edCreationTime.DateTime);
          ClaimsStandard.NotBefore := ClaimsStandard.IssuedAt;
          ClaimsStandard.JWTID := Crypt(edJWTID.Text, ckbJWTIDCrypted.Checked);
        end;
     
        MemoHeader.Lines.Clear();
        MemoPayload.Lines.Clear();
     
        if BuildJSONStrings(JSONHeader, JSONPayload) then
        begin
          MemoHeader.Lines.Text := JSONHeader;
          MemoPayload.Lines.Text := JSONPayload;
          if EncodeJSONStrings(JSONHeader, JSONPayload, EncodedPart) and SignJSONEncodedPart(EncodedPart, edKey.Text, ckbKeyBase64Encoded.Checked, Token) then
          begin
            MemoToken.Lines.Text := Token;
          end
          else
          begin
            MemoToken.Lines.Text := 'Error';
          end
        end
        else
        begin
          MemoHeader.Lines.Text := 'Error';
          MemoPayload.Lines.Text := 'Error';
        end;
      finally
        Free();
      end;
    end;
    Nom : Sans titre.png
Affichages : 102
Taille : 119,7 Ko
    Aide via F1 - FAQ - Guide du développeur Delphi devant un problème - Pensez-y !
    Attention Troll Méchant !
    "Quand un homme a faim, mieux vaut lui apprendre à pêcher que de lui donner un poisson" Confucius
    Mieux vaut se taire et paraître idiot, Que l'ouvrir et de le confirmer !
    L'ignorance n'excuse pas la médiocrité !

    L'expérience, c'est le nom que chacun donne à ses erreurs. (Oscar Wilde)
    Il faut avoir le courage de se tromper et d'apprendre de ses erreurs

  5. #5
    Membre éclairé
    Avatar de Higgins
    Inscrit en
    Juillet 2002
    Messages
    539
    Détails du profil
    Informations forums :
    Inscription : Juillet 2002
    Messages : 539
    Par défaut
    Merci pour toutes ces infos et l'exemple de code
    Je me plonge là-dedans

+ Répondre à la discussion
Cette discussion est résolue.

Discussions similaires

  1. Connexion oauth2 entre serveurs
    Par batchi dans le forum Langage
    Réponses: 1
    Dernier message: 04/09/2018, 09h58
  2. Implémenter un client/serveur gSoap
    Par r0d dans le forum C++
    Réponses: 17
    Dernier message: 12/10/2017, 15h47
  3. implementation d'un serveur syslog
    Par apabaz dans le forum Développement
    Réponses: 1
    Dernier message: 30/01/2008, 12h12
  4. Implémentation d'un serveur SMSC
    Par pdtor dans le forum Linux
    Réponses: 1
    Dernier message: 12/04/2007, 20h02
  5. implémentation d'un serveur HTTP
    Par Jérémy Lefevre dans le forum C++
    Réponses: 5
    Dernier message: 11/01/2007, 16h44

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo