使用招摇的令牌生成

时间:2019-01-24 11:55:42

标签: swagger

使用curl命令-我能够生成令牌

 curl -X POST "https://login.microsoftonline.com/ada8448e-faae-4047-99a6-15a17f4db850/oauth2/token" -H "accept: application/json" -H "Subscription_Key: e1140ee2416d442cbd3c5793d453fe73" -H "Content-Type: multipart/form-data" -F "grant_type=Client_credentials" -F "client_id=fd199a1e-1851-43a7-9fbf-fcdde1cdecbf" -F "client_secret=lGNcdjpdcw0a0c/l41AsFYICakC1B56a9DGzQ7vfWnk="

curl命令生成令牌的输出为:

   "token_type": "Bearer",
   "expires_in": "3600",
   "ext_expires_in": "3600",
   "expires_on": "1548321480",
    "not_before": "1548317580",
    "resource": "00000002-0000-0000-c000-000000000000",
     "access_token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsIng1dCI6Im5iQ3dXMTF3M1hrQi14VWFYd0tSU0xqTUhHUSIsImtpZCI6Im5iQ3dXMTF3M1hrQi14VWFYd0tSU0xqTUhHUSJ9.eyJhdWQiOiIwMDAwMDAwMi0wMDAwLTAwMDAtYzAwMC0wMDAwMDAwMDAwMDAiLCJpc3MiOiJodHRwczovL3N0cy53aW5kb3dzLm5ldC9hZGE4NDQ4ZS1mYWFlLTQwNDctOTlhNi0xNWExN2Y0ZGI4NTAvIiwiaWF0IjoxNTQ4MzE3NTgwLCJuYmYiOjE1NDgzMTc1ODAsImV4cCI6MTU0ODMyMTQ4MCwiYWlvIjoiNDJKZ1lGaFdZRnQzZnhXanpGM1JsY3RTcDV6MkJnQT0iLCJhcHBpZCI6ImZkMTk5YTFlLTE4NTEtNDNhNy05ZmJmLWZjZGRlMWNkZWNiZiIsImFwcGlkYWNyIjoiMSIsImlkcCI6Imh0dHBzOi8vc3RzLndpbmRvd3MubmV0L2FkYTg0NDhlLWZhYWUtNDA0Ny05OWE2LTE1YTE3ZjRkYjg1MC8iLCJvaWQiOiJjMjkzNTE3Yy0zZGFlLTQ3MGEtOWNhYy0yZTRiYThlZmUwZTAiLCJzdWIiOiJjMjkzNTE3Yy0zZGFlLTQ3MGEtOWNhYy0yZTRiYThlZmUwZTAiLCJ0ZW5hbnRfcmVnaW9uX3Njb3BlIjoiTkEiLCJ0aWQiOiJhZGE4NDQ4ZS1mYWFlLTQwNDctOTlhNi0xNWExN2Y0ZGI4NTAiLCJ1dGkiOiJVUEdqbzQzVFNFT3ZaQmw5S1oxYkFBIiwidmVyIjoiMS4wIn0.pZw-roudVpT2rrWTecJHdmMeitpZvKVAC2KlNkL5hRgQJ4T2ehWbj4Yck3dRt_MSP_0Bpqragszvgh6LCkNne6RqnZALujP5jREhizhKLfpM9RL1yOPMZJ3BOSxrZW0WNQJPlMUwQSwJS3_LXcqNsC0JUuvkFEQuCXLTuVtDNrLAW2oRIJ89tD7eIST9lIqER7Iui1ri1LvFrbkAa_6HxHVaJQXXK4rlOElx-ePj3LowrBIt3lrVNtTRUb_1xuRN-H5FA-fsakhRqv5wEgPi1wkrFFMddERMEFYuYyggK35GjXJxg8mvlMEk7hKw6bXAs4JrJVx5hQJDh30DVy4gpQ 

但是使用摇摇晃晃的代码,我无法通过该代码生成令牌?有人能知道我无法在swagger集线器中生成令牌的swagger代码有什么问题吗?

   swagger: '2.0'
   info:
   description: null
   version: 1.0.0
   title: null
   termsOfService: null
   contact: null
   license: null
   host: login.microsoftonline.com
   basePath: ''
 schemes:
  - https
 paths:
  /ada8448e-faae-4047-99a6-15a17f4db850/oauth2/token:
   post:
     tags:
      - test10
     summary: null
     description: null
     operationId: test10
     produces:
       - application/json
      consumes:
      - multipart/form-data
     parameters:
       - name: Subscription_Key
        in: header
        description: null
        required: false
        type: string
      - name: grant_type
        in: formData
        description: null
        required: false
        type: string
      - name: client_id
        in: formData
       description: null
       required: false
      type: string
    - name: client_secret
      in: formData
      description: null
      required: false
      type: string
    responses:
    '200':
       description: successful operation
       content:
         application/json:
       schema:
         $ref: '#/definitions/test10'
  definitions:
     test10:
      properties:
      token_type:
      type: string
      expires_in:
      type: number
      format: int32
      ext_expires_in:
      type: number
      format: int32
      expires_one:
      type: number
      format: int32
      not_before:
      type: number
      format: int32
      resource:
      type: string
      access_token:
      type: string

现在如何读取此代码以生成令牌?

0 个答案:

没有答案