-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path5ca56ca2.0b177d28.js
1 lines (1 loc) · 9.34 KB
/
5ca56ca2.0b177d28.js
1
(window.webpackJsonp=window.webpackJsonp||[]).push([[59],{160:function(e,t,n){"use strict";n.r(t),n.d(t,"frontMatter",(function(){return l})),n.d(t,"metadata",(function(){return u})),n.d(t,"rightToc",(function(){return s})),n.d(t,"default",(function(){return p}));var a=n(2),r=n(6),o=(n(0),n(250)),i=n(257),c=n(258),l={id:"authmTLS",title:"Autoriza\xe7\xe3o com mTLS",hide_title:!0,sidebar_label:"Authentication with mTLS"},u={id:"AutenticacaoEndpoints/authmTLS",isDocsHomePage:!1,title:"Autoriza\xe7\xe3o com mTLS",description:"Authorization with mTLS",source:"@site/docs\\AutenticacaoEndpoints\\authmtls.md",permalink:"/documentation/docs/AutenticacaoEndpoints/authmTLS",sidebar_label:"Authentication with mTLS",sidebar:"someSidebar",previous:{title:"Endpoints",permalink:"/documentation/docs/AutenticacaoEndpoints/Endpoints"}},s=[{value:"P12 certificate",id:"p12-certificate",children:[{value:"Generating a P12 certificate",id:"generating-a-p12-certificate",children:[]}]},{value:"Access authorization for application",id:"access-authorization-for-application",children:[]},{value:"Endpoint: Authorize",id:"endpoint-authorize",children:[]}],b={rightToc:s};function p(e){var t=e.components,n=Object(r.a)(e,["components"]);return Object(o.b)("wrapper",Object(a.a)({},b,n,{components:t,mdxType:"MDXLayout"}),Object(o.b)("h1",{className:"titulo"},"Authorization with mTLS"),Object(o.b)("div",{className:"subtitulo"},Object(o.b)("h2",{id:"p12-certificate"},"P12 certificate"),Object(o.b)("p",null,"All requests for the ",Object(o.b)("code",null,"Pix API")," must contain a security certificate that will be provided by Gestoranet within your account, in the format ",Object(o.b)("code",null,"PFX(.p12)"),".\nAuth2 provides an authorization mechanism called mutual Transport Layer Security (mTLS) through the certificate issued in your Gestoret account, this method adds another level of security to the requests trafficked between your application and the Gestoret API. This requirement is fully described in ",Object(o.b)("a",{href:"https://www.bcb.gov.br/estabilidadefinanceira/comunicacaodados",target:"_blank",alt:"manual de seguran\xe7a do pix"},"PIX Security Manual"),"."),Object(o.b)("h3",{id:"generating-a-p12-certificate"},"Generating a P12 certificate"),Object(o.b)("p",null,"To generate your certificate, just follow the steps below:"),Object(o.b)("ol",null,Object(o.b)("li",{parentName:"ol"},'Access the item "API" in the top menu of the Gest\xe3onet account;'),Object(o.b)("li",{parentName:"ol"},'On the left menu, click on "My Certificates";'),Object(o.b)("li",{parentName:"ol"},"In the new window, select the environment to which the certificate will belong (Production or Approval)"),Object(o.b)("li",{parentName:"ol"},'Click on "New Certificate" (orange button);'),Object(o.b)("li",{parentName:"ol"},"Assign a description to the certificate to identify it in the future;"),Object(o.b)("li",{parentName:"ol"},"Confirm the certificate creation;"),Object(o.b)("li",{parentName:"ol"},"Finally, download the certificate.")),Object(o.b)("br",null),Object(o.b)("h2",{id:"access-authorization-for-application"},"Access authorization for application"),Object(o.b)("p",null,"The Gerencianet API is ",Object(o.b)("a",{href:"http://www.restapitutorial.com/",target:"_blank",title:"[link externo]"},"RESTful"),", the requests/responses are in JSON and we use the ",Object(o.b)("a",{href:"http://oauth.net/2/",target:"_blank"},"OAuth2")," as an API authorization framework. OAuth2 requests must use their respective base ",Object(o.b)("em",null,"endpoint"),":"),Object(o.b)(i.a,{defaultValue:"desenvolvimento",values:[{label:"Homologation",value:"desenvolvimento"},{label:"Production",value:"producao"}],mdxType:"Tabs"},Object(o.b)(c.a,{value:"desenvolvimento",mdxType:"TabItem"},Object(o.b)("pre",null,Object(o.b)("code",Object(a.a)({parentName:"pre"},{className:"language-json"}),'"URL": {\n "sandbox": "https://api-pix-h.gerencianet.com.br"\n },\n'))),Object(o.b)(c.a,{value:"producao",mdxType:"TabItem"},Object(o.b)("pre",null,Object(o.b)("code",Object(a.a)({parentName:"pre"},{className:"language-json"}),'"URL": {\n "production": "https://api-pix.gerencianet.com.br"\n },\n')))),Object(o.b)("br",null),Object(o.b)("h2",{id:"endpoint-authorize"},"Endpoint: Authorize"),Object(o.b)("p",null,"The Gerencianet API supports the ",Object(o.b)("a",{href:"http://oauth.net/2/",target:"_blank"},"OAuth 2.0")," protocol to authorize access to the API. Requests are authenticated using ",Object(o.b)("a",{href:"https://en.wikipedia.org/wiki/Basic_access_authentication",target:"_blank",title:"External Link"},"HTTP Basic Auth"),"."),Object(o.b)("p",null,"The purpose of the OAuth2 protocol is to exchange a chain of tokens between the ",Object(o.b)("em",{parentName:"p"},"Client")," and ",Object(o.b)("em",{parentName:"p"},"Server Resource"),". This token is used to authenticate all API calls using ",Object(o.b)("em",{parentName:"p"},"Authorization")," in the HTTP header."),Object(o.b)("p",null,"The base ",Object(o.b)("em",null,"endpoint")," for authentication is represented below:"),Object(o.b)(i.a,{defaultValue:"auth",values:[{label:"Endpoint: Authorize",value:"auth"}],mdxType:"Tabs"},Object(o.b)(c.a,{value:"auth",mdxType:"TabItem"},Object(o.b)("pre",null,Object(o.b)("code",Object(a.a)({parentName:"pre"},{className:"language-json"}),'"authorize": {\n "route": "/oauth/token",\n "method": "post"\n'))))))}p.isMDXComponent=!0},250:function(e,t,n){"use strict";n.d(t,"a",(function(){return b})),n.d(t,"b",(function(){return d}));var a=n(0),r=n.n(a);function o(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function i(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function c(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?i(Object(n),!0).forEach((function(t){o(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):i(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function l(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},o=Object.keys(e);for(a=0;a<o.length;a++)n=o[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(a=0;a<o.length;a++)n=o[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var u=r.a.createContext({}),s=function(e){var t=r.a.useContext(u),n=t;return e&&(n="function"==typeof e?e(t):c(c({},t),e)),n},b=function(e){var t=s(e.components);return r.a.createElement(u.Provider,{value:t},e.children)},p={inlineCode:"code",wrapper:function(e){var t=e.children;return r.a.createElement(r.a.Fragment,{},t)}},h=r.a.forwardRef((function(e,t){var n=e.components,a=e.mdxType,o=e.originalType,i=e.parentName,u=l(e,["components","mdxType","originalType","parentName"]),b=s(n),h=a,d=b["".concat(i,".").concat(h)]||b[h]||p[h]||o;return n?r.a.createElement(d,c(c({ref:t},u),{},{components:n})):r.a.createElement(d,c({ref:t},u))}));function d(e,t){var n=arguments,a=t&&t.mdxType;if("string"==typeof e||a){var o=n.length,i=new Array(o);i[0]=h;var c={};for(var l in t)hasOwnProperty.call(t,l)&&(c[l]=t[l]);c.originalType=e,c.mdxType="string"==typeof e?e:a,i[1]=c;for(var u=2;u<o;u++)i[u]=n[u];return r.a.createElement.apply(null,i)}return r.a.createElement.apply(null,n)}h.displayName="MDXCreateElement"},254:function(e,t,n){"use strict";function a(e){var t,n,r="";if("string"==typeof e||"number"==typeof e)r+=e;else if("object"==typeof e)if(Array.isArray(e))for(t=0;t<e.length;t++)e[t]&&(n=a(e[t]))&&(r&&(r+=" "),r+=n);else for(t in e)e[t]&&(r&&(r+=" "),r+=t);return r}t.a=function(){for(var e,t,n=0,r="";n<arguments.length;)(e=arguments[n++])&&(t=a(e))&&(r&&(r+=" "),r+=t);return r}},255:function(e,t,n){"use strict";var a=n(0);const r=Object(a.createContext)({tabGroupChoices:{},setTabGroupChoices:()=>{},isAnnouncementBarClosed:!1,closeAnnouncementBar:()=>{}});t.a=r},256:function(e,t,n){"use strict";var a=n(0),r=n(255);t.a=function(){return Object(a.useContext)(r.a)}},257:function(e,t,n){"use strict";var a=n(0),r=n.n(a),o=n(256),i=n(254),c=n(92),l=n.n(c);const u=37,s=39;t.a=function(e){const{block:t,children:n,defaultValue:c,values:b,groupId:p}=e,{tabGroupChoices:h,setTabGroupChoices:d}=Object(o.a)(),[f,m]=Object(a.useState)(c);if(null!=p){const e=h[p];null!=e&&e!==f&&b.some(t=>t.value===e)&&m(e)}const O=e=>{m(e),null!=p&&d(p,e)},j=[];return r.a.createElement("div",null,r.a.createElement("ul",{role:"tablist","aria-orientation":"horizontal",className:Object(i.a)("tabs",{"tabs--block":t})},b.map(({value:e,label:t})=>r.a.createElement("li",{role:"tab",tabIndex:"0","aria-selected":f===e,className:Object(i.a)("tabs__item",l.a.tabItem,{"tabs__item--active":f===e}),key:e,ref:e=>j.push(e),onKeyDown:e=>((e,t,n)=>{switch(n.keyCode){case s:((e,t)=>{const n=e.indexOf(t)+1;e[n]?e[n].focus():e[0].focus()})(e,t);break;case u:((e,t)=>{const n=e.indexOf(t)-1;e[n]?e[n].focus():e[e.length-1].focus()})(e,t)}})(j,e.target,e),onFocus:()=>O(e),onClick:()=>O(e)},t))),r.a.createElement("div",{role:"tabpanel",className:"margin-vert--md"},a.Children.toArray(n).filter(e=>e.props.value===f)[0]))}},258:function(e,t,n){"use strict";var a=n(0),r=n.n(a);t.a=function(e){return r.a.createElement("div",null,e.children)}}}]);