           "github" (str (gh-utils/http-endpoint) "/" (vcs-url/project-name (:vcs_url project)) "/settings/keys"))
         (and (= "github-user-key" (:type key)) (= (:login key) (:login user)))
         (str (gh-utils/http-endpoint) "/settings/ssh")
-
+        (and (= "bitbucket-user-key" (:type key))
+             (= (:login key) (-> user :bitbucket :login)))
+        (str (bb-utils/http-endpoint) "/account/user/" (:login key)
+             "/ssh-keys/")
         :else nil))
 
 (defn checkout-key-description [key project]
   (condp = (:type key)
     "deploy-key" (str (vcs-url/project-name (:vcs_url project)) " deploy key")
     "github-user-key" (str (:login key) " user key")
+    "bitbucket-user-key" (str (:login key) " user key")
     nil))
+
+(defmulti add-user-key-section (fn [data owner] (-> data :project-data :project :vcs-type keyword)))
+
+(defmethod add-user-key-section :github [data owner]
+  (reify
+    om/IRender
+    (render [_]
+      (let [user (:user data)
+            project-data (:project-data data)
+            project (:project project-data)
+            checkout-keys (:checkout-keys project-data)
+            project-id (project-model/id project)
+            project-name (vcs-url/project-name (:vcs_url project))]
+        (html
+         [:div.add-key
+          [:h4 "Add user key"]
+          [:p
+           "If a deploy key can't access all of your project's private dependencies, we can configure it to use an SSH key with the same level of access to GitHub repositories that you have."]
+          [:div.authorization
+           (if-not (user-model/public-key-scope? user)
+             (list
+              [:p "In order to do so, you'll need to grant authorization from GitHub to the \"admin:public_key\" scope. This will allow us to add a new authorized public key to your GitHub account."]
+              [:a.btn.ghu-authorize
+               {:href (gh-utils/auth-url :scope ["admin:public_key" "user:email" "repo"])
+                :title "Grant admin:public_key authorization so that we can add a new SSH key to your GitHub account"}
+               "Authorize w/ GitHub " [:i.fa.fa-github]])
+
+             [:div.request-user
+              (forms/managed-button
+               [:input.btn
+                {:tooltip "{ title: 'Create a new user key for this project, with access to all of the projects of your GitHub account.', animation: false }"
+                 :type "submit"
+                 :on-click #(do (raise! owner [:new-checkout-key-clicked {:project-id project-id
+                                                                          :project-name project-name
+                                                                          :key-type "github-user-key"}])
+                                false)
+                 :value (str "Create and add " (:login user) " user key" )
+                 :data-loading-text "Saving..."
+                 :data-success-text "Saved"}])])]])))))
+
+(defmethod add-user-key-section :bitbucket [data owner]
+  (reify
+    om/IRender
+    (render [_]
+      (let [user (:user data)
+            project-data (:project-data data)
+            project (:project project-data)
+            checkout-keys (:checkout-keys project-data)
+            project-id (project-model/id project)
+            project-name (vcs-url/project-name (:vcs_url project))]
+        (html
+         [:div.add-key
+          [:h4 "Create user key"]
+          [:p
+           "If a deploy key can't access all of your project's private dependencies, we can help you setup an SSH key with the same level of access to Bitbucket repositories that you have."]
+          [:div.authorization
+           [:div.request-user
+            (forms/managed-button
+             [:input.btn
+              {:tooltip "{ title: 'Create a new user key for this project, with access to all of the projects of your Bitbucket account.', animation: false }"
+               :type "submit"
+               :on-click #(do (raise! owner [:new-checkout-key-clicked {:project-id project-id
+                                                                        :project-name project-name
+                                                                        :key-type "bitbucket-user-key"}])
+                              false)
+               :value (str "Create " (:login user) " user key" )
+               :data-loading-text "Creating..."
+               :data-success-text "Created"}])]]])))))
+
+(defn bitbucket-add-user-key-instructions [data owner]
+  (reify
+    om/IRender
+    (render [_]
+      (let [{:keys [user key]} data]
+        (html
+         [:div.add-key
+          [:h4 "Add user key to Bitbucket"]
+          [:p "You now need to add this key to your "
+           [:a {:href
+                (str "https://bitbucket.org/account/user/"
+                     (-> user :bitbucket :login)
+                     "/ssh-keys/")}
+            "Bitbucket account SSH keys"]]
+          [:p
+           [:ol
+            [:li "Navigate to your " [:a {:href (checkout-key-link key nil user)}
+                                      "Bitbucket account SSH keys"]]
+            [:li "Click \"Add key\""]
+            [:li
+             "Copy this public key and paste it into the new key on Bitbucket"
+             [:pre.wrap-words
+              (:public_key key)]]
+            [:li "Save the new key"]]]])))))
 
 (defn checkout-ssh-keys [data owner]
   (reify

                 [:div
                  [:p
                   "Here are the keys we can currently use to check out your project, submodules, "
                   "and private GitHub dependencies. The currently preferred key is highlighted, but "
                   "we will automatically fall back to the other keys if the preferred key is revoked."]
                  [:table.table
                   [:thead [:th "Description"] [:th "Fingerprint"] [:th]]

                 [:div.add-key
                  [:h4 "Add deploy key"]
                  [:p
                   "Deploy keys are the best option for most projects: they only have access to a single " vcs-name " repository."]
                  [:div.request-user
                   (forms/managed-button
                    [:input.btn
