---
title: "如何在使用WSE3.0的Server端取得UserToken"
author: "cpsing"
date: "2008-09-26T17:28:00Z"
tags: []
slug: "wse3-0-server-usertoken"
draft: false
lastmod: "2008-09-26T17:28:00Z"
id: 257017
url: "https://cpsing.iteye.com/blog/257017"
---

string test = "";  
       string tokenStr = string.Empty;  
       UsernameToken token;  
       SecurityContextToken tokens = RequestSoapContext.Current.IdentityToken as SecurityContextToken;  
       if (null != tokens)  
       {  
           token = tokens.BaseToken as UsernameToken;  
           test = token.Password;  
       }