1"use strict";(self.webpackChunkphpvms_docs=self.webpackChunkphpvms_docs||[]).push([[2110],{54687(e,t,n){n.r(t),n.d(t,{assets:()=>c,contentTitle:()=>r,default:()=>h,frontMatter:()=>a,metadata:()=>s,toc:()=>d});const s=JSON.parse('{"id":"oauth/vatsim","title":"VATSIM","description":"First, you need to","source":"@site/versioned_docs/version-v7.x/oauth/vatsim.md","sourceDirName":"oauth","slug":"/oauth/vatsim","permalink":"/oauth/vatsim","draft":false,"unlisted":false,"editUrl":"https://github.com/phpvms/docs/tree/master/versioned_docs/version-v7.x/oauth/vatsim.md","tags":[],"version":"v7.x","frontMatter":{"id":"vatsim","title":"VATSIM","sidebar_title":"VATSIM"},"sidebar":"docs","previous":{"title":"IVAO","permalink":"/oauth/ivao"},"next":{"title":"Layouts and Template Basics","permalink":"/customize/layouts"}}');var i=n(74848),o=n(28453);const a={id:"vatsim",title:"VATSIM",sidebar_title:"VATSIM"},r=void 0,c={},d=[{value:"Customizing scopes",id:"customizing-scopes",level:2}];function l(e){const t={a:"a",code:"code",h2:"h2",img:"img",p:"p",pre:"pre",...(0,o.R)(),...e.components};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(t.p,{children:["First, you need to\n",(0,i.jsx)(t.a,{href:"https://auth.vatsim.net/organization/requirements",children:"create a vatsim organization"}),"\non the VATSIM website."]}),"\n",(0,i.jsxs)(t.p,{children:["After your organization has been approved by VATSIM, you can create a new OAuth\nclient. Go to the ",(0,i.jsx)(t.a,{href:"https://auth.vatsim.net/organization",children:"Organizations"})," tab and\ninto the organization you created. Navigate to the 'OAuth clients' tab and add a\nnew client. In the redirect URL, enter:\n",(0,i.jsx)(t.code,{children:"https://yourdomain.com/oauth/vatsim/callback"})]}),"\n",(0,i.jsx)(t.p,{children:(0,i.jsx)(t.img,{src:n(7574).A+"",width:"1661",height:"482"})}),"\n",(0,i.jsxs)(t.p,{children:["In the ",(0,i.jsx)(t.code,{children:".env"})," file, add the following:"]}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-shell",metastring:'title=".env"',children:"VATSIM_OAUTH_ENABLED=true\nVATSIM_CLIENT_ID={your_client_id}\nVATSIM_CLIENT_SECRET={your_client_secret}\n"})}),"\n",(0,i.jsx)(t.p,{children:"You can retrieve your client ID and your client secret from the OAuth clients\npage after creating the client as explained above."}),"\n",(0,i.jsx)(t.p,{children:'Now, your users can link their VATSIM account to their phpvms account and use\ntheir VATSIM account to log in. The link between the two accounts is\nautomatically established when clicking the "Login with VATSIM" button on the\nlogin page. However, if the email address of the VATSIM account is different\nfrom the email address of the phpvms account, it must be done manually on the\nprofile page.'}),"\n",(0,i.jsx)(t.h2,{id:"customizing-scopes",children:"Customizing scopes"}),"\n",(0,i.jsxs)(t.p,{children:["You can add scopes to the OAuth request in addition to the default scopes by\nadding your scopes to the ",(0,i.jsx)(t.code,{children:".env"})," file, separated by commas. See\n",(0,i.jsx)(t.a,{href:"https://vatsim.dev/api/connect-api/redirect",children:"VATSIM Scopes List"})]}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-shell",metastring:'title=".env"',children:"VATSIM_SCOPES=scope1,scope2\n"})})]})}function h(e={}){const{wrapper:t}={...(0,o.R)(),...e.components};return t?(0,i.jsx)(t,{...e,children:(0,i.jsx)(l,{...e})}):l(e)}},7574(e,t,n){n.d(t,{A:()=>s});const s=n.p+"assets/images/create-vatsim-43171e28d7899bf84b60bd726be39a17.png"},28453(e,t,n){n.d(t,{R:()=>a,x:()=>r});var s=n(96540);const i={},o=s.createContext(i);function a(e){const t=s.useContext(o);return s.useMemo(function(){return"function"==typeof e?e(t):{...t,...e}},[t,e])}function r(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(i):e.components||i:a(e.components),s.createElement(o.Provider,{value:t},e.children)}}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.