development:security
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| development:security [2016/11/12 03:07] – anthonysena | development:security [2018/03/20 13:33] (current) – anthonysena | ||
|---|---|---|---|
| Line 16: | Line 16: | ||
| ==== SECURITY LAYER ==== | ==== SECURITY LAYER ==== | ||
| - | The '' | + | The '' |
| - | Active implementation | + | The default setting in the WebAPI pom.xml |
| - | + | ||
| - | @Component | + | |
| - | @Primary | + | |
| - | public class DisabledSecurity extends Security { | + | |
| - | | + | |
| - | } | + | |
| ==== PATH-BASED SECURITY ==== | ==== PATH-BASED SECURITY ==== | ||
| Line 52: | Line 46: | ||
| === OAUTH SETTINGS === | === OAUTH SETTINGS === | ||
| - | Currently supported providers are Google and Facebook. | + | Currently supported |
| To be able to use API of OAuth service provider you need to obtain API Key and API Secret and put these values into POM file | To be able to use API of OAuth service provider you need to obtain API Key and API Secret and put these values into POM file | ||
| Line 61: | Line 55: | ||
| < | < | ||
| - | === ADDING NEW OAUTH PROVIDER === | + | ==== ADDING NEW OAUTH PROVIDER |
| OAuth authentication is handled with [[https:// | OAuth authentication is handled with [[https:// | ||
| Line 129: | Line 123: | ||
| If authentication completes successfully, | If authentication completes successfully, | ||
| + | |||
| + | ==== BASIC SECURITY CONFIGURATION ==== | ||
| + | |||
| + | In the event that you do not have one of the supported OAuth providers available, WebAPI also supports as [[documentation: | ||
| ==== AUTHORIZAION ==== | ==== AUTHORIZAION ==== | ||
| Line 259: | Line 257: | ||
| * Now you need to follow instructions of CA (Certification Authority) of your choice to submit your CSR (for example VeriSign) to obtain the SSL certifiate. Alternatively, | * Now you need to follow instructions of CA (Certification Authority) of your choice to submit your CSR (for example VeriSign) to obtain the SSL certifiate. Alternatively, | ||
| - | * When you obtained certificate from CA, you need to import | + | * When you obtained certificate from CA, you need to import |
| + | |||
| + | === Step 1: Retrieving | ||
| + | |||
| + | * Take your SSL certificate with a .cer extension. and double click on it. | ||
| + | * At the certificate popup click on Certification Path. | ||
| + | * {{: | ||
| + | * Under Certification Path you will see a tier of three certificates. | ||
| + | * Top certificate = Root | ||
| + | * Middle certificate = Intermediate | ||
| + | * Bottom certificate = SSL certificate for the common name it was issued to. | ||
| + | * {{: | ||
| + | * **Double click** on the **top certificate Root** in order to bring up its information. | ||
| + | * {{: | ||
| + | * Click **Details.** | ||
| + | * Click **Copy to File...** | ||
| + | * {{: | ||
| + | * The Certificate Export Wizard will popup. Click **Next.** | ||
| + | * {{: | ||
| + | * Select **Base-64 encoded X.509 (.cer).** | ||
| + | * Click **Next.** | ||
| + | * {{: | ||
| + | * On the next screen click **Browse** and specify the filename and path you want to save your Root certificate. Name it whatever you desire. **Example: Root.cer** | ||
| + | * Click **Save.** | ||
| + | * You will be taken back to the previous screen with the location and path of this file specified next to browse. **Click Next.** | ||
| + | * {{: | ||
| + | * Complete the export wizard by clicking **Finish**. | ||
| + | |||
| + | === Step 2: Retrieving your Intermediate CA directly from your SSL certificate (Continued) === | ||
| + | |||
| + | //You will perform the same steps as above in step 1 but with the middle certificate (Intermediate).// | ||
| + | |||
| + | * 1. Go back to your SSL certificate under the **Certification Path** tab and **double click** on the Middle Certificate Intermediate in the tier. | ||
| + | * {{: | ||
| + | * Click Details. | ||
| + | * Click Copy to File… | ||
| + | * {{: | ||
| + | * The Certificate Export Wizard will popup. **Click Next.** | ||
| + | * {{: | ||
| + | * Select **Base-64 encoded X.509 (.cer).** | ||
| + | * Click **Next.** | ||
| + | * {{: | ||
| + | * On the next screen click Browse and specify the filename and path you want to save your Intermediate certificate. Name it whatever you desire. Example: Intermediate.cer | ||
| + | * Click Save. | ||
| + | * You will be taken back to the previous screen with the location and path of this file specified next to browse. Click Next. | ||
| + | * {{: | ||
| + | * Complete the export wizard by clicking Finish. | ||
| + | |||
| + | You should now have three files: | ||
| + | - Your Root Certificate. | ||
| + | - Your Intermediate Certificate. | ||
| + | - Your SSL certificate where both the Root, and Intermediate are derived from. | ||
| + | |||
| + | === Step 3: Step 3: Installing your Root CA, CA Intermediate, | ||
| + | |||
| + | Import the Root Certificate first. | ||
| + | |||
| + | keytool -import -alias root -trustcacerts -file C: | ||
| + | |||
| + | Import the Intermediate CA certificate second. You will specify your own alias for this import. Example: Intermediate. | ||
| + | |||
| + | keytool -import -alias intermediate -trustcacerts -file C: | ||
| + | |||
| + | Lastly, import the actual SSL certificate into the keystore. | ||
| keytool -importcert -trustcacerts -alias webapi -file C: | keytool -importcert -trustcacerts -alias webapi -file C: | ||
| - | Now you can add SSL connector in Tomcat' | + | Now you can add SSL connector in Tomcat' |
| - | | + | |
| - | port=" | + | port=" |
| - | protocol=" | + | protocol=" |
| - | maxThreads=" | + | maxThreads=" |
| - | scheme=" | + | scheme=" |
| - | secure=" | + | secure=" |
| - | SSLEnabled=" | + | SSLEnabled=" |
| - | keyAlias=" | + | keyAlias=" |
| - | keystoreFile=" | + | keystoreFile=" |
| - | keystorePass=" | + | keystorePass=" |
| - | clientAuth=" | + | clientAuth=" |
| - | sslProtocol=" | + | sslProtocol=" |
| [[https:// | [[https:// | ||
development/security.1478920065.txt.gz · Last modified: by anthonysena
